Skip to content

Commit 043d9b4

Browse files
committed
Only allow arbitrary tokens after a type (potential optional semicolon)
1 parent 7ba0f60 commit 043d9b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hscript/Parser.hx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,10 @@ class Parser {
606606
{
607607
case TOp("="): e = parseExpr();
608608
case TOp(_): unexpected(tk);
609-
// TComma | TSemicolon | TMeta should be enough? but would need more testing
610-
default: push(tk);
609+
case TComma | TSemicolon: push(tk);
610+
// Above case should be enough but semicolon is not mandatory after }
611+
case _ if (t != null): push(tk);
612+
default: unexpected(tk);
611613
}
612614

613615
mk(EVar(ident,t,e),p1,(e == null) ? tokenMax : pmax(e));

0 commit comments

Comments
 (0)