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
2b3a9101
Commit
2b3a9101
authored
Jan 24, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Group <INITIAL,ATTR> tokens together.
parent
88fa3459
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
23 deletions
+29
-23
parser.l
tools/widl/parser.l
+29
-23
No files found.
tools/widl/parser.l
View file @
2b3a9101
...
@@ -140,7 +140,6 @@ struct uuid *parse_uuid(const char *u)
...
@@ -140,7 +140,6 @@ struct uuid *parse_uuid(const char *u)
*/
*/
%%
%%
<INITIAL>^{ws}*\#{ws}*pragma{ws}+ yy_push_state(PP_PRAGMA);
<INITIAL>^{ws}*\#{ws}*pragma{ws}+ yy_push_state(PP_PRAGMA);
<INITIAL,ATTR>^{ws}*\#{ws}* yy_push_state(PP_LINE);
<PP_LINE>[^\n]* {
<PP_LINE>[^\n]* {
int lineno;
int lineno;
char *cptr, *fname;
char *cptr, *fname;
...
@@ -202,40 +201,47 @@ struct uuid *parse_uuid(const char *u)
...
@@ -202,40 +201,47 @@ struct uuid *parse_uuid(const char *u)
<SQUOTE>\\\' addcchar(yytext[1]);
<SQUOTE>\\\' addcchar(yytext[1]);
<QUOTE,WSTRQUOTE,SQUOTE>\\. addcchar('\\'); addcchar(yytext[1]);
<QUOTE,WSTRQUOTE,SQUOTE>\\. addcchar('\\'); addcchar(yytext[1]);
<QUOTE,WSTRQUOTE,SQUOTE>. addcchar(yytext[0]);
<QUOTE,WSTRQUOTE,SQUOTE>. addcchar(yytext[0]);
<INITIAL,ATTR>\[ yy_push_state(ATTR); return '[';
<ATTR>\] yy_pop_state(); return ']';
<ATTR>\] yy_pop_state(); return ']';
<ATTR>{cident} return attr_token(yytext, yylval);
<ATTR>{cident} return attr_token(yytext, yylval);
<ATTR>{uuid} {
<ATTR>{uuid} {
yylval->uuid = parse_uuid(yytext);
yylval->uuid = parse_uuid(yytext);
return aUUID;
return aUUID;
}
}
<INITIAL,ATTR>{hex} {
yylval->num = xstrtoul(yytext, NULL, 0);
return aHEXNUM;
}
<INITIAL,ATTR>{int} {
yylval->num = xstrtoul(yytext, NULL, 0);
return aNUM;
}
<INITIAL>{double} {
<INITIAL>{double} {
yylval->dbl = strtod(yytext, NULL);
yylval->dbl = strtod(yytext, NULL);
return aDOUBLE;
return aDOUBLE;
}
}
SAFEARRAY{ws}*/\( return tSAFEARRAY;
SAFEARRAY{ws}*/\( return tSAFEARRAY;
{cident} return kw_token(yytext, yylval);
{cident} return kw_token(yytext, yylval);
<INITIAL,ATTR>\n line_number++;
<INITIAL,ATTR>{ws}
<INITIAL,ATTR>{
<INITIAL,ATTR>\<\< return SHL;
^{ws}*\#{ws}* { yy_push_state(PP_LINE); }
<INITIAL,ATTR>\>\> return SHR;
\[ { yy_push_state(ATTR); return '['; }
<INITIAL,ATTR>\-\> return MEMBERPTR;
<INITIAL,ATTR>== return EQUALITY;
{hex} {
<INITIAL,ATTR>!= return INEQUALITY;
yylval->num = xstrtoul(yytext, NULL, 0);
<INITIAL,ATTR>\>= return GREATEREQUAL;
return aHEXNUM;
<INITIAL,ATTR>\<= return LESSEQUAL;
}
<INITIAL,ATTR>\|\| return LOGICALOR;
{int} {
<INITIAL,ATTR>&& return LOGICALAND;
yylval->num = xstrtoul(yytext, NULL, 0);
<INITIAL,ATTR>\.\.\. return ELLIPSIS;
return aNUM;
<INITIAL,ATTR>. return yytext[0];
}
\n { line_number++; }
{ws} {}
\<\< { return SHL; }
\>\> { return SHR; }
\-\> { return MEMBERPTR; }
== { return EQUALITY; }
!= { return INEQUALITY; }
\>= { return GREATEREQUAL; }
\<= { return LESSEQUAL; }
\|\| { return LOGICALOR; }
&& { return LOGICALAND; }
\.\.\. { return ELLIPSIS; }
. { return yytext[0]; }
}
<<EOF>> {
<<EOF>> {
if (!list_empty( &import_stack ))
if (!list_empty( &import_stack ))
return aEOF;
return aEOF;
...
...
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