Commit cb1a8a3c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Short if statement may have optional 'end if'.

parent fdf2e15b
......@@ -221,9 +221,13 @@ IfStatement
: tIF Expression tTHEN tNL StatementsNl ElseIfs_opt Else_opt tEND tIF
{ $$ = new_if_statement(ctx, $2, $5, $6, $7); CHECK_ERROR; }
| tIF Expression tTHEN Statement { $$ = new_if_statement(ctx, $2, $4, NULL, NULL); CHECK_ERROR; }
| tIF Expression tTHEN Statement tELSE Statement
| tIF Expression tTHEN Statement tELSE Statement EndIf_opt
{ $$ = new_if_statement(ctx, $2, $4, NULL, $6); CHECK_ERROR; }
EndIf_opt
: /* empty */
| tEND tIF
ElseIfs_opt
: /* empty */ { $$ = NULL; }
| ElseIfs { $$ = $1; }
......
......@@ -209,6 +209,8 @@ if false then :
if false then x = y : if true then call ok(false, "embedded if called")
if false then x=1 else x=2 end if
if false then
ok false, "if false called"
end if
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment