From aa95d8a9bcc39fe66fc80eac3b359d05fbc3c83d Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 28 Oct 2019 18:39:38 +0100 Subject: [PATCH] vbscript: Move sign expression to a separated rule. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/vbscript/parser.y | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 8ecdf47c08c..000ab5bf33b 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -126,7 +126,7 @@ static statement_t *link_statements(statement_t*,statement_t*); %type Statement SimpleStatement StatementNl StatementsNl StatementsNl_opt BodyStatements IfStatement Else_opt %type Expression LiteralExpression PrimaryExpression EqualityExpression CallExpression ExpressionNl_opt %type ConcatExpression AdditiveExpression ModExpression IntdivExpression MultiplicativeExpression ExpExpression -%type NotExpression UnaryExpression AndExpression OrExpression XorExpression EqvExpression +%type NotExpression UnaryExpression AndExpression OrExpression XorExpression EqvExpression SignExpression %type ConstExpression NumericLiteralExpression %type MemberExpression %type Arguments_opt ArgumentList ArgumentList_opt Step_opt ExpressionList @@ -369,15 +369,18 @@ MultiplicativeExpression { $$ = new_binary_expression(ctx, EXPR_DIV, $1, $3); CHECK_ERROR; } ExpExpression - : UnaryExpression { $$ = $1; } - | ExpExpression '^' UnaryExpression { $$ = new_binary_expression(ctx, EXPR_EXP, $1, $3); CHECK_ERROR; } + : SignExpression { $$ = $1; } + | ExpExpression '^' SignExpression { $$ = new_binary_expression(ctx, EXPR_EXP, $1, $3); CHECK_ERROR; } + +SignExpression + : UnaryExpression { $$ = $1; } + | '-' SignExpression { $$ = new_unary_expression(ctx, EXPR_NEG, $2); CHECK_ERROR; } + | '+' SignExpression { $$ = $2; } UnaryExpression : LiteralExpression { $$ = $1; } | CallExpression { $$ = $1; } | tNEW Identifier { $$ = new_new_expression(ctx, $2); CHECK_ERROR; } - | '-' UnaryExpression { $$ = new_unary_expression(ctx, EXPR_NEG, $2); CHECK_ERROR; } - | '+' UnaryExpression { $$ = $2; } CallExpression : PrimaryExpression { $$ = $1; }