Skip to content
Snippets Groups Projects
Commit 45adc4d3 authored by Stephen Lavelle's avatar Stephen Lavelle Committed by Marijn Haverbeke
Browse files

[haxe mode] Treat types as expressions when parsing an expression

Closes #3513

Not 100% sure that this is the best way to deal with this - but if
you're in an expression, and encounter what you think is a type, it's
probably better to change your assumption and treat it as you would a
variable/constant (Because that's what it probably is) rather than to
forget everything.

I ran the test suite, and it didn't break anything, and the linter,
which was quiet.
parent 44d30d7c
No related branches found
No related tags found
No related merge requests found
......@@ -264,6 +264,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
}
function expression(type) {
if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
if (type == "type" ) return cont(maybeoperator);
if (type == "function") return cont(functiondef);
if (type == "keyword c") return cont(maybeexpression);
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment