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
071b0a55
Commit
071b0a55
authored
Mar 23, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Enable bison locations option.
parent
2edd194a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
parser.h
tools/widl/parser.h
+1
-1
parser.l
tools/widl/parser.l
+8
-3
parser.y
tools/widl/parser.y
+3
-1
No files found.
tools/widl/parser.h
View file @
071b0a55
...
...
@@ -26,7 +26,7 @@
int
parser_parse
(
void
);
extern
void
generic_msg
(
const
struct
location
*
where
,
const
char
*
s
,
const
char
*
t
,
va_list
ap
);
extern
void
parser_error
(
const
char
*
message
);
extern
void
parser_error
(
const
struct
location
*
where
,
const
char
*
message
);
extern
void
init_location
(
struct
location
*
where
);
extern
FILE
*
parser_in
;
...
...
tools/widl/parser.l
View file @
071b0a55
...
...
@@ -19,6 +19,7 @@
*/
%option bison-bridge
%option bison-locations
%option stack
%option noinput nounput noyy_top_state
%option noyywrap
...
...
@@ -53,6 +54,7 @@ uuid {hd}{8}-{hd}{4}-{hd}{4}-{hd}{4}-{hd}{12}
#define YYerror PARSER_error
#define YYSTYPE PARSER_STYPE
#define YYLTYPE PARSER_LTYPE
#define YYUNDEF PARSER_UNDEF
#define yyerror parser_error
...
...
@@ -197,13 +199,16 @@ static void winrt_enable( int ns_prefix )
}
}
<PP_LINE>[0-9]+{ws}* {
line_number = strtoul( yytext, NULL, 10 ) - 1; /* We didn't read the newline */
yylloc->first_line = strtoul( yytext, NULL, 10 ) - 1;
yylloc->last_line = yylloc->first_line;
line_number = yylloc->first_line;
yy_pop_state();
yy_push_state(PP_FILE);
}
<PP_FILE>\"(\\[^n]|[^"\\\n])*\"{ws}* {
input_name = xstrdup( yytext + 1 );
*strchr( input_name, '"' ) = 0;
yylloc->input_name = input_name;
}
<PP_FILE>[^"][^\n]* { yy_pop_state(); }
...
...
@@ -557,9 +562,9 @@ void generic_msg( const struct location *where, const char *s, const char *t, va
}
/* yyerror: yacc assumes this is not newline terminated. */
void parser_error( const char *message )
void parser_error( const
struct location *where, const
char *message )
{
error_
loc(
"%s\n", message );
error_
at( where,
"%s\n", message );
}
static void warning_disable(int warning)
...
...
tools/widl/parser.y
View file @
071b0a55
...
...
@@ -124,15 +124,17 @@ static typelib_t *current_typelib;
%code provides
{
int parser_lex( PARSER_STYPE *yylval );
int parser_lex( PARSER_STYPE *yylval
, PARSER_LTYPE *yylloc
);
void push_import( char *input_name );
void pop_import(void);
}
%define api.location.type {struct location}
%define api.prefix {parser_}
%define api.pure full
%define parse.error verbose
%locations
%union {
attr_t *attr;
...
...
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