vbscript: Fix compile when statement after ElseIf or after separator.

This commit is contained in:
Jason Millard 2023-02-14 10:02:09 -05:00 committed by Alexandre Julliard
parent aa7a6b8f42
commit 887e72b24e
2 changed files with 18 additions and 1 deletions

View file

@ -314,7 +314,7 @@ ElseIfs
| ElseIf ElseIfs { $1->next = $2; $$ = $1; }
ElseIf
: tELSEIF Expression tTHEN tNL StatementsNl_opt
: tELSEIF Expression tTHEN StSep_opt StatementsNl_opt
{ $$ = new_elseif_decl(ctx, @$, $2, $5); }
Else_opt

View file

@ -337,6 +337,23 @@ ElseIf not False Then
End If
Call ok(x, "elseif not called?")
' ElseIf with statement on same line
x = false
If false Then
Call ok(false, "inside if false")
ElseIf not False Then x = true
End If
Call ok(x, "elseif not called?")
' ElseIf with statement following statement separator
x = false
If false Then
Call ok(false, "inside if false")
ElseIf not False Then
: x = true
End If
Call ok(x, "elseif not called?")
x = false
if 1 then x = true
Call ok(x, "if 1 not run?")