Commit 20b2d057 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Fixed parsing if statements with empty body.

parent 3b9a13e9
......@@ -228,7 +228,7 @@ Step_opt
| tSTEP Expression { $$ = $2; }
IfStatement
: tIF Expression tTHEN tNL StatementsNl ElseIfs_opt Else_opt tEND tIF
: tIF Expression tTHEN tNL StatementsNl_opt 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 EndIf_opt
......@@ -247,12 +247,12 @@ ElseIfs
| ElseIf ElseIfs { $1->next = $2; $$ = $1; }
ElseIf
: tELSEIF Expression tTHEN tNL StatementsNl
: tELSEIF Expression tTHEN tNL StatementsNl_opt
{ $$ = new_elseif_decl(ctx, $2, $5); }
Else_opt
: /* empty */ { $$ = NULL; }
| tELSE tNL StatementsNl { $$ = $3; }
| tELSE tNL StatementsNl_opt { $$ = $3; }
CaseClausules
: /* empty */ { $$ = NULL; }
......
......@@ -290,6 +290,22 @@ while not (x and y)
wend
call ok((x and y), "x or y is false after while")
if false then
' empty body
end if
if false then
x = false
elseif true then
' empty body
end if
if false then
x = false
else
' empty body
end if
while false
wend
......
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