Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c3dde3bd
Commit
c3dde3bd
authored
Oct 28, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbcript: Allow any call expression in call and assign statements.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f9bf6f0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
9 deletions
+46
-9
parser.y
dlls/vbscript/parser.y
+46
-9
No files found.
dlls/vbscript/parser.y
View file @
c3dde3bd
...
...
@@ -44,6 +44,7 @@ static expression_t *new_new_expression(parser_ctx_t*,const WCHAR*);
static member_expression_t *new_member_expression(parser_ctx_t*,expression_t*,const WCHAR*);
static call_expression_t *new_call_expression(parser_ctx_t*,expression_t*,expression_t*);
static call_expression_t *make_call_expression(parser_ctx_t*,expression_t*,expression_t*);
static void *new_statement(parser_ctx_t*,statement_type_t,size_t);
static statement_t *new_call_statement(parser_ctx_t*,BOOL,expression_t*);
...
...
@@ -130,7 +131,7 @@ static statement_t *link_statements(statement_t*,statement_t*);
%type <expression> NotExpression UnaryExpression AndExpression OrExpression XorExpression EqvExpression SignExpression
%type <expression> ConstExpression NumericLiteralExpression
%type <member> MemberExpression
%type <expression> Arguments_opt ArgumentList ArgumentList_opt Step_opt ExpressionList
%type <expression> Arguments
Arguments
_opt ArgumentList ArgumentList_opt Step_opt ExpressionList
%type <boolean> OptionExplicit_opt DoType
%type <arg_decl> ArgumentsDecl_opt ArgumentDeclList ArgumentDecl
%type <func_decl> FunctionDecl PropertyDecl
...
...
@@ -186,10 +187,11 @@ Statement
| SimpleStatement ':' { $$ = $1; }
SimpleStatement
: MemberExpression ArgumentList_opt { $$ = new_call_statement(ctx, FALSE, &new_call_expression(ctx, &$1->expr, $2)->expr); CHECK_ERROR; }
: CallExpression ArgumentList_opt { call_expression_t *call_expr = make_call_expression(ctx, $1, $2); CHECK_ERROR;
$$ = new_call_statement(ctx, FALSE, &call_expr->expr); CHECK_ERROR; };
| tCALL UnaryExpression { $$ = new_call_statement(ctx, TRUE, $2); CHECK_ERROR; }
|
MemberExpression Arguments_opt
'=' Expression
{ $$ = new_assign_statement(ctx,
&new_call_expression(ctx, &$1->expr, $2)->expr, $4
); CHECK_ERROR; }
|
CallExpression
'=' Expression
{ $$ = new_assign_statement(ctx,
$1, $3
); CHECK_ERROR; }
| tDIM DimDeclList { $$ = new_dim_statement(ctx, $2); CHECK_ERROR; }
| IfStatement { $$ = $1; }
| tWHILE Expression StSep StatementsNl_opt tWEND
...
...
@@ -289,12 +291,16 @@ CaseClausules
| tCASE ExpressionList StSep StatementsNl_opt CaseClausules
{ $$ = new_case_clausule(ctx, $2, $4, $5); }
Arguments
_opt
:
EmptyBrackets_opt
{ $$ = NULL; }
Arguments
:
tEMPTYBRACKETS
{ $$ = NULL; }
| '(' ArgumentList ')' { $$ = $2; }
Arguments_opt
: /* empty */ { $$ = NULL; }
| Arguments { $$ = $1; }
ArgumentList_opt
:
EmptyBrackets_opt
{ $$ = NULL; }
:
/* empty */
{ $$ = NULL; }
| ArgumentList { $$ = $1; }
ArgumentList
...
...
@@ -384,8 +390,10 @@ UnaryExpression
| tNEW Identifier { $$ = new_new_expression(ctx, $2); CHECK_ERROR; }
CallExpression
: PrimaryExpression { $$ = $1; }
| MemberExpression Arguments_opt { $$ = &new_call_expression(ctx, &$1->expr, $2)->expr; CHECK_ERROR; }
: PrimaryExpression { $$ = $1; }
| MemberExpression { $$ = &$1->expr; }
| CallExpression Arguments { call_expression_t *expr = new_call_expression(ctx, $1, $2); CHECK_ERROR;
$$ = &expr->expr; }
LiteralExpression
: tTRUE { $$ = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; }
...
...
@@ -691,6 +699,35 @@ static call_expression_t *new_call_expression(parser_ctx_t *ctx, expression_t *e
return call_expr;
}
static call_expression_t *make_call_expression(parser_ctx_t *ctx, expression_t *callee_expr, expression_t *arguments)
{
call_expression_t *call_expr;
if(callee_expr->type == EXPR_MEMBER)
return new_call_expression(ctx, callee_expr, arguments);
if(callee_expr->type != EXPR_CALL) {
FIXME("Unhandled for expr type %u\n", callee_expr->type);
ctx->hres = E_FAIL;
return NULL;
}
call_expr = (call_expression_t*)callee_expr;
if(!call_expr->args) {
call_expr->args = arguments;
}else if(call_expr->args->next) {
FIXME("Invalid syntax: invalid use of parentheses for arguments\n");
ctx->hres = E_FAIL;
return NULL;
}else if(arguments->type != EXPR_NOARG) {
FIXME("Invalid syntax: missing comma\n");
ctx->hres = E_FAIL;
return NULL;
}else {
call_expr->args->next = arguments->next;
}
return call_expr;
}
static expression_t *new_new_expression(parser_ctx_t *ctx, const WCHAR *identifier)
{
string_expression_t *expr;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment