comparison src/luan/interp/LuaParser.java @ 33:8793c71ad47a

change numeric for syntax git-svn-id: https://luan-java.googlecode.com/svn/trunk@34 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Sun, 16 Dec 2012 05:07:42 +0000
parents c3eab5a3ce3c
children 0cdc1da466ee
comparison
equal deleted inserted replaced
32:c3eab5a3ce3c 33:8793c71ad47a
275 ); 275 );
276 } 276 }
277 277
278 Rule NumericForStmt() { 278 Rule NumericForStmt() {
279 return Sequence( 279 return Sequence(
280 Keyword("for"), Name(), '=', Spaces(), Expr(), ',', Spaces(), Expr(), 280 Keyword("for"), Name(), '=', Spaces(), Expr(), Keyword("to"), Expr(),
281 push( new ConstExpr(new LuaNumber(1)) ), // default step 281 push( new ConstExpr(new LuaNumber(1)) ), // default step
282 Optional( 282 Optional(
283 ',', Spaces(), 283 Keyword("step"),
284 drop(), 284 drop(),
285 Expr() 285 Expr()
286 ), 286 ),
287 addSymbol( (String)pop(3) ), // add "for" var to symbols 287 addSymbol( (String)pop(3) ), // add "for" var to symbols
288 Keyword("do"), LoopBlock(), Keyword("end"), 288 Keyword("do"), LoopBlock(), Keyword("end"),
773 "nil", 773 "nil",
774 "not", 774 "not",
775 "or", 775 "or",
776 "repeat", 776 "repeat",
777 "return", 777 "return",
778 "step",
778 "then", 779 "then",
780 "to",
779 "true", 781 "true",
780 "until", 782 "until",
781 "while" 783 "while"
782 )); 784 ));
783 785