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
fd4c3475
Commit
fd4c3475
authored
Nov 30, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use separated parser rule for property definition.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9193b9f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
parser.y
dlls/jscript/parser.y
+17
-12
No files found.
dlls/jscript/parser.y
View file @
fd4c3475
...
...
@@ -45,8 +45,10 @@ typedef struct _property_list_t {
property_definition_t *tail;
} property_list_t;
static property_list_t *new_property_list(parser_ctx_t*,literal_t*,expression_t*);
static property_list_t *property_list_add(parser_ctx_t*,property_list_t*,literal_t*,expression_t*);
static property_definition_t *new_property_definition(parser_ctx_t *ctx, literal_t *name,
expression_t *value);
static property_list_t *new_property_list(parser_ctx_t*,property_definition_t*);
static property_list_t *property_list_add(parser_ctx_t*,property_list_t*,property_definition_t*);
typedef struct _element_list_t {
array_element_t *head;
...
...
@@ -156,6 +158,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state
const WCHAR *identifier;
struct _parameter_list_t *parameter_list;
struct _property_list_t *property_list;
property_definition_t *property_definition;
source_elements_t *source_elements;
statement_t *statement;
struct _statement_list_t *statement_list;
...
...
@@ -237,6 +240,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state
%type <ival> Elision Elision_opt
%type <element_list> ElementList
%type <property_list> PropertyNameAndValueList
%type <property_definition> PropertyDefinition
%type <literal> PropertyName
%type <literal> BooleanLiteral
%type <srcptr> KFunction
...
...
@@ -789,10 +793,14 @@ ObjectLiteral
/* ECMA-262 3rd Edition 11.1.5 */
PropertyNameAndValueList
: PropertyDefinition { $$ = new_property_list(ctx, $1); }
| PropertyNameAndValueList ',' PropertyDefinition
{ $$ = property_list_add(ctx, $1, $3); }
/* ECMA-262 5.1 Edition 12.2.6 */
PropertyDefinition
: PropertyName ':' AssignmentExpression
{ $$ = new_property_list(ctx, $1, $3); }
| PropertyNameAndValueList ',' PropertyName ':' AssignmentExpression
{ $$ = property_list_add(ctx, $1, $3, $5); }
{ $$ = new_property_definition(ctx, $1, $3); }
/* ECMA-262 3rd Edition 11.1.5 */
PropertyName
...
...
@@ -932,19 +940,16 @@ static property_definition_t *new_property_definition(parser_ctx_t *ctx, literal
return ret;
}
static property_list_t *new_property_list(parser_ctx_t *ctx,
literal_t *name, expression_t *value
)
static property_list_t *new_property_list(parser_ctx_t *ctx,
property_definition_t *prop
)
{
property_list_t *ret = parser_alloc_tmp(ctx, sizeof(property_list_t));
ret->head = ret->tail = new_property_definition(ctx, name, value);
ret->head = ret->tail = prop;
return ret;
}
static property_list_t *property_list_add(parser_ctx_t *ctx, property_list_t *list,
literal_t *name, expression_t *value
)
static property_list_t *property_list_add(parser_ctx_t *ctx, property_list_t *list,
property_definition_t *prop
)
{
list->tail = list->tail->next = new_property_definition(ctx, name, value);
list->tail = list->tail->next = prop;
return list;
}
...
...
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