vbscript: Added support for parentheses in expressions.

This commit is contained in:
Jacek Caban 2011-09-09 14:47:21 +02:00 committed by Alexandre Julliard
parent 8108b4040c
commit a17f9aa07a
2 changed files with 6 additions and 1 deletions

View File

@ -73,7 +73,7 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
%token <string> tIdentifier tString %token <string> tIdentifier tString
%type <statement> Statement StatementNl %type <statement> Statement StatementNl
%type <expression> Expression LiteralExpression %type <expression> Expression LiteralExpression PrimaryExpression
%type <member> MemberExpression %type <member> MemberExpression
%type <expression> Arguments_opt ArgumentList_opt ArgumentList %type <expression> Arguments_opt ArgumentList_opt ArgumentList
%type <bool> OptionExplicit_opt %type <bool> OptionExplicit_opt
@ -120,12 +120,16 @@ EmptyBrackets_opt
Expression Expression
: LiteralExpression /* FIXME */ { $$ = $1; } : LiteralExpression /* FIXME */ { $$ = $1; }
| PrimaryExpression /* FIXME */ { $$ = $1; }
LiteralExpression LiteralExpression
: tTRUE { $$ = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; } : tTRUE { $$ = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; }
| tFALSE { $$ = new_bool_expression(ctx, VARIANT_FALSE); CHECK_ERROR; } | tFALSE { $$ = new_bool_expression(ctx, VARIANT_FALSE); CHECK_ERROR; }
| tString { $$ = new_string_expression(ctx, $1); CHECK_ERROR; } | tString { $$ = new_string_expression(ctx, $1); CHECK_ERROR; }
PrimaryExpression
: '(' Expression ')' { $$ = $2; }
%% %%
static int parser_error(const char *str) static int parser_error(const char *str)

View File

@ -20,5 +20,6 @@ Option Explicit
call ok(true, "true is not true?") call ok(true, "true is not true?")
ok true, "true is not true?" ok true, "true is not true?"
call ok((true), "true is not true?")
reportSuccess() reportSuccess()