From a17f9aa07ad94888a21cc14c83d47fa923d30974 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 9 Sep 2011 14:47:21 +0200 Subject: [PATCH] vbscript: Added support for parentheses in expressions. --- dlls/vbscript/parser.y | 6 +++++- dlls/vbscript/tests/lang.vbs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 258420de1a8..728d69bbec4 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -73,7 +73,7 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*); %token tIdentifier tString %type Statement StatementNl -%type Expression LiteralExpression +%type Expression LiteralExpression PrimaryExpression %type MemberExpression %type Arguments_opt ArgumentList_opt ArgumentList %type OptionExplicit_opt @@ -120,12 +120,16 @@ EmptyBrackets_opt Expression : LiteralExpression /* FIXME */ { $$ = $1; } + | PrimaryExpression /* FIXME */ { $$ = $1; } LiteralExpression : tTRUE { $$ = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; } | tFALSE { $$ = new_bool_expression(ctx, VARIANT_FALSE); CHECK_ERROR; } | tString { $$ = new_string_expression(ctx, $1); CHECK_ERROR; } +PrimaryExpression + : '(' Expression ')' { $$ = $2; } + %% static int parser_error(const char *str) diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 07585fa841a..32fc903517f 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -20,5 +20,6 @@ Option Explicit call ok(true, "true is not true?") ok true, "true is not true?" +call ok((true), "true is not true?") reportSuccess()