vbscript: Simplify option explicit parsing.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-01-22 23:27:45 +01:00 committed by Alexandre Julliard
parent b2de64eeed
commit 12b1bcdb95
1 changed files with 4 additions and 10 deletions

View File

@ -27,7 +27,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript);
static int parser_error(unsigned*,parser_ctx_t*,const char*); static int parser_error(unsigned*,parser_ctx_t*,const char*);
static void parse_complete(parser_ctx_t*,BOOL);
static void handle_isexpression_script(parser_ctx_t *ctx, expression_t *expr); static void handle_isexpression_script(parser_ctx_t *ctx, expression_t *expr);
static void source_add_statement(parser_ctx_t*,statement_t*); static void source_add_statement(parser_ctx_t*,statement_t*);
@ -138,7 +137,7 @@ static statement_t *link_statements(statement_t*,statement_t*);
%type <expression> ConstExpression NumericLiteralExpression %type <expression> ConstExpression NumericLiteralExpression
%type <member> MemberExpression %type <member> MemberExpression
%type <expression> Arguments Arguments_opt ArgumentList ArgumentList_opt Step_opt ExpressionList %type <expression> Arguments Arguments_opt ArgumentList ArgumentList_opt Step_opt ExpressionList
%type <boolean> OptionExplicit_opt DoType Preserve_opt %type <boolean> DoType Preserve_opt
%type <arg_decl> ArgumentsDecl_opt ArgumentDeclList ArgumentDecl %type <arg_decl> ArgumentsDecl_opt ArgumentDeclList ArgumentDecl
%type <func_decl> FunctionDecl PropertyDecl %type <func_decl> FunctionDecl PropertyDecl
%type <elseif> ElseIfs_opt ElseIfs ElseIf %type <elseif> ElseIfs_opt ElseIfs ElseIf
@ -153,12 +152,12 @@ static statement_t *link_statements(statement_t*,statement_t*);
%% %%
Program Program
: OptionExplicit_opt SourceElements { parse_complete(ctx, $1); } : OptionExplicit_opt SourceElements
| tEXPRESSION ExpressionNl_opt { handle_isexpression_script(ctx, $2); } | tEXPRESSION ExpressionNl_opt { handle_isexpression_script(ctx, $2); }
OptionExplicit_opt OptionExplicit_opt
: /* empty */ { $$ = FALSE; } : /* empty */
| tOPTION tEXPLICIT StSep { $$ = TRUE; } | tOPTION tEXPLICIT StSep { ctx->option_explicit = TRUE; }
SourceElements SourceElements
: /* empty */ : /* empty */
@ -534,11 +533,6 @@ static void source_add_class(parser_ctx_t *ctx, class_decl_t *class_decl)
ctx->class_decls = class_decl; ctx->class_decls = class_decl;
} }
static void parse_complete(parser_ctx_t *ctx, BOOL option_explicit)
{
ctx->option_explicit = option_explicit;
}
static void handle_isexpression_script(parser_ctx_t *ctx, expression_t *expr) static void handle_isexpression_script(parser_ctx_t *ctx, expression_t *expr)
{ {
retval_statement_t *stat; retval_statement_t *stat;