Jacek Caban (@jacek) commented about dlls/vbscript/parser.y:
- { $$ = new_elseif_decl(ctx, @$, $2, $5); } + : tELSEIF Expression tTHEN StSep StatementsNl_opt + { $$ = new_elseif_decl(ctx, @$, $2, $5); } + | tELSEIF Expression tTHEN InlineStatements_opt + { $$ = new_elseif_decl(ctx, @$, $2, $4); }
Else_opt : /* empty */ { $$ = NULL; } - | tELSE StSep_opt StatementsNl_opt { $$ = $3; } + | tELSE StSep StatementsBody { $$ = $3; } + | tELSE InlineStatements { $$ = $2; } + +StatementsBody + : /* empty */ { $$ = NULL; } + | SimpleStatement { $$ = $1; } + | SimpleStatement StSep StatementsBody { $1->next = $3; $$ = $1; } It is identical to `InlineStatements_opt` below, let's not duplicate it.
Also, please keep bracket indentation consistent within a rule. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10333#note_132569