Add foreach and limit

This commit is contained in:
Nicolas Williams committed 2014-07-06 19:40:05 -05:00
1 parent d0ca11d665
commit 5a863bf010
7 files changed
+88

No files matched your search

+6
View File
@@ -63,6 +63,7 @@ struct lexer_param;
%token ELSE "else"
%token ELSE_IF "elif"
%token REDUCE "reduce"
%token FOREACH "foreach"
%token END "end"
%token AND "and"
%token OR "or"
@@ -234,6 +235,11 @@ Term "as" '$' IDENT '|' Exp {
jv_free($5);
} |
"foreach" Term "as" '$' IDENT '(' Exp ';' Exp ';' Exp ')' {
$$ = gen_foreach(jv_string_value($5), $2, $7, $9, $11);
jv_free($5);
} |
"if" Exp "then" Exp ElseBody {
$$ = gen_cond($2, $4, $5);
} |