diff --git a/hscript/Parser.hx b/hscript/Parser.hx index 9b521ea..43a82f0 100644 --- a/hscript/Parser.hx +++ b/hscript/Parser.hx @@ -211,7 +211,16 @@ class Parser { return makeUnop(op,parseExpr()); return unexpected(tk); case TBkOpen: - return parseExprNext(EArrayDecl(parseExprList(TBkClose))); + var a = new Array(); + tk = token(); + while( tk != TBkClose ) { + tokens.add(tk); + a.push(parseExpr()); + tk = token(); + if( tk == TComma ) + tk = token(); + } + return parseExprNext(EArrayDecl(a)); default: return unexpected(tk); }