Jacek Caban : vbscript: Added support for parentheses in expressions.
Module: wine Branch: master Commit: a17f9aa07ad94888a21cc14c83d47fa923d30974 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a17f9aa07ad94888a21cc14c83... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 9 14:47:21 2011 +0200 vbscript: Added support for parentheses in expressions. --- dlls/vbscript/parser.y | 6 +++++- dlls/vbscript/tests/lang.vbs | 1 + 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 258420d..728d69b 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 <string> tIdentifier tString %type <statement> Statement StatementNl -%type <expression> Expression LiteralExpression +%type <expression> Expression LiteralExpression PrimaryExpression %type <member> MemberExpression %type <expression> Arguments_opt ArgumentList_opt ArgumentList %type <bool> 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 07585fa..32fc903 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()
participants (1)
-
Alexandre Julliard