diff --git a/hscript/Parser.hx b/hscript/Parser.hx index 1f4a53e..0361843 100644 --- a/hscript/Parser.hx +++ b/hscript/Parser.hx @@ -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]) ) {