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
e9afe272
Commit
e9afe272
authored
Apr 14, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Apr 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Check that attributes applied to typedefs and fields are applicable and…
widl: Check that attributes applied to typedefs and fields are applicable and issue an error otherwise.
parent
5f39b415
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
2 deletions
+30
-2
parser.y
tools/widl/parser.y
+30
-2
No files found.
tools/widl/parser.y
View file @
e9afe272
...
@@ -132,6 +132,8 @@ static void check_arg(var_t *arg);
...
@@ -132,6 +132,8 @@ static void check_arg(var_t *arg);
static void check_all_user_types(ifref_list_t *ifaces);
static void check_all_user_types(ifref_list_t *ifaces);
static const attr_list_t *check_iface_attrs(const char *name, const attr_list_t *attrs);
static const attr_list_t *check_iface_attrs(const char *name, const attr_list_t *attrs);
static attr_list_t *check_function_attrs(const char *name, attr_list_t *attrs);
static attr_list_t *check_function_attrs(const char *name, attr_list_t *attrs);
static attr_list_t *check_typedef_attrs(attr_list_t *attrs);
static attr_list_t *check_field_attrs(const char *name, attr_list_t *attrs);
#define tsENUM 1
#define tsENUM 1
#define tsSTRUCT 2
#define tsSTRUCT 2
...
@@ -655,7 +657,7 @@ field: s_field ';' { $$ = $1; }
...
@@ -655,7 +657,7 @@ field: s_field ';' { $$ = $1; }
;
;
s_field: m_attributes type pident array { $$ = $3->var;
s_field: m_attributes type pident array { $$ = $3->var;
$$->attrs =
$1
;
$$->attrs =
check_field_attrs($$->name, $1)
;
set_type($$, $2, $3, $4, FALSE);
set_type($$, $2, $3, $4, FALSE);
free($3);
free($3);
}
}
...
@@ -928,7 +930,7 @@ type: tVOID { $$ = duptype(find_type("void", 0), 1); }
...
@@ -928,7 +930,7 @@ type: tVOID { $$ = duptype(find_type("void", 0), 1); }
| tSAFEARRAY '(' type ')' { $$ = make_safearray($3); }
| tSAFEARRAY '(' type ')' { $$ = make_safearray($3); }
;
;
typedef: tTYPEDEF m_attributes type pident_list { reg_typedefs($3, $4,
$2
);
typedef: tTYPEDEF m_attributes type pident_list { reg_typedefs($3, $4,
check_typedef_attrs($2)
);
process_typedefs($4);
process_typedefs($4);
}
}
;
;
...
@@ -2249,6 +2251,32 @@ static void check_arg(var_t *arg)
...
@@ -2249,6 +2251,32 @@ static void check_arg(var_t *arg)
}
}
}
}
static attr_list_t *check_typedef_attrs(attr_list_t *attrs)
{
const attr_t *attr;
if (!attrs) return attrs;
LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
{
if (!allowed_attr[attr->type].on_type)
error_loc("inapplicable attribute %s for typedef\n",
allowed_attr[attr->type].display_name);
}
return attrs;
}
static attr_list_t *check_field_attrs(const char *name, attr_list_t *attrs)
{
const attr_t *attr;
if (!attrs) return attrs;
LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
{
if (!allowed_attr[attr->type].on_field)
error_loc("inapplicable attribute %s for field %s\n",
allowed_attr[attr->type].display_name, name);
}
return attrs;
}
static void check_all_user_types(ifref_list_t *ifrefs)
static void check_all_user_types(ifref_list_t *ifrefs)
{
{
const ifref_t *ifref;
const ifref_t *ifref;
...
...
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