diff options
Diffstat (limited to 'parse.cxx')
-rw-r--r-- | parse.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -543,6 +543,7 @@ lexer::scan () || n->content == "for" || n->content == "foreach" || n->content == "in" + || n->content == "limit" || n->content == "return" || n->content == "delete" || n->content == "while" @@ -1518,6 +1519,7 @@ parser::parse_foreach_loop () foreach_loop* s = new foreach_loop; s->tok = t; s->sort_direction = 0; + s->limit = NULL; t = next (); if (! (t->type == tok_operator && t->content == "(")) @@ -1591,6 +1593,13 @@ parser::parse_foreach_loop () next(); } + t = peek (); + if (tok_is(t, tok_keyword, "limit")) + { + next (); // get past the "limit" + s->limit = parse_expression (); + } + t = next (); if (! (t->type == tok_operator && t->content == ")")) throw parse_error ("expected ')'"); |