+ // Control Statements
+ case TOK_RWD_IF:
+ {
+ tAST_Node *cond, *true, *false = NULL;
+ GetToken(Parser); // eat the if
+ SyntaxAssert(Parser, GetToken(Parser), TOK_PAREN_OPEN);
+ cond = Parse_DoExpr0(Parser); // Get condition
+ SyntaxAssert(Parser, GetToken(Parser), TOK_PAREN_CLOSE);
+ true = Parse_DoCodeBlock(Parser);
+ if( LookAhead(Parser) == TOK_RWD_ELSE ) {
+ GetToken(Parser);
+ false = Parse_DoCodeBlock(Parser);
+ }
+ ret = AST_NewIf(cond, true, false);
+ }
+ return ret;
+ case TOK_RWD_FOR:
+ case TOK_RWD_DO:
+ case TOK_RWD_WHILE:
+ TODO(Parser, "Implement if, for, do and while\n");
+ break;
+