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

This commit is contained in:
Jacek Caban 2012-04-13 17:40:40 +02:00 committed by Alexandre Julliard
parent fdf2e15b80
commit cb1a8a3c58
2 changed files with 7 additions and 1 deletions

View file

@ -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; }

View file

@ -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