Array parse fix
Do not allow arrays without comma between values (https://github.com/HaxeFoundation/hscript/pull/138)
This commit is contained in:
+8
-2
@@ -481,15 +481,21 @@ class Parser {
|
||||
case TBkOpen:
|
||||
var a = [];
|
||||
tk = token();
|
||||
var first:Bool = true;
|
||||
while( tk != TBkClose && (!resumeErrors || tk != TEof) ) {
|
||||
if(!first) {
|
||||
if(tk != TComma)
|
||||
unexpected(tk);
|
||||
else
|
||||
tk = token();
|
||||
}
|
||||
first = false;
|
||||
push(tk);
|
||||
var oldoo = disableOrOp;
|
||||
disableOrOp = false;
|
||||
a.push(parseExpr());
|
||||
disableOrOp = oldoo;
|
||||
tk = token();
|
||||
if( tk == TComma )
|
||||
tk = token();
|
||||
}
|
||||
if( a.length == 1 && a[0] != null ) // What is this for???
|
||||
switch( expr(a[0]) ) {
|
||||
|
||||
Reference in New Issue
Block a user