From eb7de55ea9ce0ca7cec39dd9e48e0158e05d3f3c Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 8 Oct 2010 15:09:31 +0000 Subject: [PATCH] added while() loop... really just creates a ForNode with empty first and third part git-svn-id: svn://anubis/fart/trunk@368 7f9b0f55-74a9-4bce-be96-3c2cd072584d --- parser/parser.yy | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/parser/parser.yy b/parser/parser.yy index f99332c..4c931e4 100644 --- a/parser/parser.yy +++ b/parser/parser.yy @@ -213,6 +213,7 @@ general_item: AMBIENT vector3 { $$ = new AmbientNode($2); } | UP vector3 { $$ = new UpNode($2); } | vector2 { $$ = $1; } | VFOV expression { $$ = new VFOVNode($2); } + | while { $$ = $1; } | WIDTH expression { $$ = new WidthNode($2); } ; @@ -430,6 +431,12 @@ for: FOR LPAREN maybe_expression SEMICOLON bool_expression SEMICOLON maybe_expre } ; +while: WHILE LPAREN bool_expression RPAREN LCURLY general_items RCURLY { + $$ = new ForNode(NULL, $3, NULL); + $$->addChildren($6); + } + ; + if: IF LPAREN bool_expression RPAREN LCURLY general_items RCURLY if_more { $$ = new IfNode($3, $8); $$->addChildren($6);