Diff
Not logged in

Differences From Artifact [4856c979362ef435]:

To Artifact [1d6de9cb69bbf7d4]:


188 188 return e; 189 189 } 190 190 191 191 if( tryEat("fun") ) 192 192 { 193 193 eat("(", "after fun"); 194 194 string[] params; 195 - for(;;) 195 + while(!tryEat(")")) 196 196 { 197 197 if( lex.empty ) { 198 198 auto e = ParserException.create(lex,"Unexpected EOF"); 199 199 throw e; 200 200 } 201 201 if( lex.front.kind != Token.Kind.identifier ) { 202 202 auto e = ParserException.create(lex,"Identifier Expected for parameters"); ................................................................................ 306 306 new IntLiteralExpression(null, BigInt(1)), 307 307 new FuncallExpression(null, 308 308 new FunLiteralExpression(null, ["abc"], [ 309 309 ]), 310 310 new IntLiteralExpression(null, BigInt(4)) 311 311 )))); 312 312 } 313 +unittest 314 +{ 315 + auto p = parserFromString(`var x = 1; var f = fun(){x=x+1;}; f(); f(); x;`); 316 + Program prog = p.parseProgram(); 317 +}