Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3d4dcc2a
Commit
3d4dcc2a
authored
Mar 16, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure we display the correct file name and line in error messages.
parent
34ef9824
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
9 deletions
+39
-9
parser.l
tools/widl/parser.l
+34
-5
utils.c
tools/widl/utils.c
+1
-1
widl.c
tools/widl/widl.c
+4
-3
No files found.
tools/widl/parser.l
View file @
3d4dcc2a
...
...
@@ -30,6 +30,7 @@ hex 0x{hexd}+
uuid {hexd}{8}-{hexd}{4}-{hexd}{4}-{hexd}{4}-{hexd}{12}
%x QUOTE
%x pp_line
%{
...
...
@@ -69,6 +70,8 @@ static int kw_token(const char *kw);
#define MAX_IMPORT_DEPTH 10
struct {
YY_BUFFER_STATE state;
char *input_name;
int line_number;
char *temp_name;
} import_stack[MAX_IMPORT_DEPTH];
int import_stack_ptr = 0;
...
...
@@ -103,7 +106,26 @@ static UUID* parse_uuid(const char*u)
**************************************************************************
*/
%%
^#.*
<INITIAL>^{ws}*\#{ws}* yy_push_state(pp_line);
<pp_line>[^\n]* {
int lineno;
char *cptr, *fname;
yy_pop_state();
lineno = (int)strtol(yytext, &cptr, 10);
if(!lineno)
yyerror("Malformed '#...' line-directive; invalid linenumber");
fname = strchr(cptr, '"');
if(!fname)
yyerror("Malformed '#...' line-directive; missing filename");
fname++;
cptr = strchr(fname, '"');
if(!cptr)
yyerror("Malformed '#...' line-directive; missing terminating \"");
*cptr = '\0';
line_number = lineno - 1; /* We didn't read the newline */
free( input_name );
input_name = xstrdup(fname);
}
\" yy_push_state(QUOTE); cbufidx = 0;
<QUOTE>\" {
yy_pop_state();
...
...
@@ -127,7 +149,7 @@ static UUID* parse_uuid(const char*u)
return aNUM;
}
{cident} return kw_token(yytext);
\n
\n
line_number++;
{ws}
\<\< return SHL;
\>\> return SHR;
...
...
@@ -314,6 +336,9 @@ static void pop_import(void)
free(temp_name);
}
temp_name = import_stack[ptr].temp_name;
free( input_name );
input_name = import_stack[ptr].input_name;
line_number = import_stack[ptr].line_number;
import_stack_ptr--;
}
...
...
@@ -325,14 +350,15 @@ struct imports {
int do_import(char *fname)
{
FILE *f;
char *hname, *path;
char *hname, *path
, *p
;
struct imports *import;
int ptr = import_stack_ptr;
int ret;
if (!parse_only) {
hname = dup_basename(fname, ".idl");
strcat(hname, ".h");
p = hname + strlen(hname) - 2;
if (p <= hname || strcmp( p, ".h" )) strcat(hname, ".h");
fprintf(header, "#include \"%s\"\n", hname);
free(hname);
...
...
@@ -352,10 +378,13 @@ int do_import(char *fname)
yyerror("Unable to open include file %s", fname);
import_stack[ptr].temp_name = temp_name;
import_stack[ptr].input_name = input_name;
import_stack[ptr].line_number = line_number;
import_stack_ptr++;
input_name = path;
line_number = 1;
ret = wpp_parse_temp( path, NULL, &temp_name );
free( path );
if (ret) exit(1);
if((f = fopen(temp_name, "r")) == NULL)
...
...
tools/widl/utils.c
View file @
3d4dcc2a
...
...
@@ -50,7 +50,7 @@ void make_print(char *str)
static
void
generic_msg
(
const
char
*
s
,
const
char
*
t
,
const
char
*
n
,
va_list
ap
)
{
fprintf
(
stderr
,
"%s:%d:
%d: %s: "
,
input_name
?
input_name
:
"stdin"
,
line_number
,
char
_number
,
t
);
fprintf
(
stderr
,
"%s:%d:
%s: "
,
input_name
?
input_name
:
"stdin"
,
line
_number
,
t
);
vfprintf
(
stderr
,
s
,
ap
);
#ifdef WANT_NEAR_INDICATION
{
...
...
tools/widl/widl.c
View file @
3d4dcc2a
...
...
@@ -99,7 +99,6 @@ char *proxy_token;
char
*
temp_name
;
int
line_number
=
1
;
int
char_number
=
1
;
FILE
*
header
;
FILE
*
proxy
;
...
...
@@ -180,7 +179,7 @@ int main(int argc,char *argv[])
}
if
(
optind
<
argc
)
{
input_name
=
argv
[
optind
]
;
input_name
=
xstrdup
(
argv
[
optind
])
;
}
else
{
fprintf
(
stderr
,
usage
);
...
...
@@ -266,7 +265,7 @@ int main(int argc,char *argv[])
if
(
ret
)
{
exit
(
1
);
}
header_name
=
NULL
;
return
0
;
}
...
...
@@ -275,6 +274,8 @@ static void rm_tempfile(void)
abort_import
();
if
(
temp_name
)
unlink
(
temp_name
);
if
(
header_name
)
unlink
(
header_name
);
}
static
void
segvhandler
(
int
sig
)
...
...
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