Fix line numbers in error and warning messages which were accumulately one less than they should have been after parsing each %include/%import - bug introduced in swig-1.3.32. Also fix line numbers in error and warning messages when new line characters appear between the %include / %import statement and the filename.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12199 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1e6ed0843f
commit
a44f83cf05
3 changed files with 19 additions and 8 deletions
|
|
@ -5,10 +5,18 @@ See the RELEASENOTES file for a summary of changes in each release.
|
||||||
Version 2.0.1 (in progress)
|
Version 2.0.1 (in progress)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
2010-09-02: wsfulton
|
||||||
|
Fix line numbers in error and warning messages which were accumulately one
|
||||||
|
less than they should have been after parsing each %include/%import - bug
|
||||||
|
introduced in swig-1.3.32. Also fix line numbers in error and warning messages
|
||||||
|
when new line characters appear between the %include / %import statement and
|
||||||
|
the filename.
|
||||||
|
|
||||||
2010-08-30: wsfulton
|
2010-08-30: wsfulton
|
||||||
Fix line number and file name reporting for some macro preprocessor warnings.
|
Fix line number and file name reporting for some macro preprocessor warnings.
|
||||||
The line number of the macro argument has been corrected and the line number
|
The line number of the macro argument has been corrected and the line number
|
||||||
of the start of the macro instead of one past the end is used. Some examples:
|
of the start of the macro instead of one past the end of the macro is used.
|
||||||
|
Some examples:
|
||||||
file.h:11: Error: Illegal macro argument name '..'
|
file.h:11: Error: Illegal macro argument name '..'
|
||||||
file.h:19: Error: Macro 'DUPLICATE' redefined,
|
file.h:19: Error: Macro 'DUPLICATE' redefined,
|
||||||
file.h:15: Error: previous definition of 'DUPLICATE'.
|
file.h:15: Error: previous definition of 'DUPLICATE'.
|
||||||
|
|
@ -50,7 +58,7 @@ Version 2.0.1 (in progress)
|
||||||
adjust your regular expressions syntax as the new regex encoder uses
|
adjust your regular expressions syntax as the new regex encoder uses
|
||||||
Perl-compatible syntax and not (extended) POSIX syntax as the old one.
|
Perl-compatible syntax and not (extended) POSIX syntax as the old one.
|
||||||
|
|
||||||
*** POTENTIAL INCOMPATIBILITY ***
|
*** POTENTIAL INCOMPATIBILITY ***
|
||||||
|
|
||||||
2010-07-13: vadz
|
2010-07-13: vadz
|
||||||
Add "regexmatch", "regextarget" and "notregexmatch" which can be
|
Add "regexmatch", "regextarget" and "notregexmatch" which can be
|
||||||
|
|
|
||||||
|
|
@ -2121,7 +2121,7 @@ include_directive: includetype options string LBRACKET {
|
||||||
} interface RBRACKET {
|
} interface RBRACKET {
|
||||||
String *mname = 0;
|
String *mname = 0;
|
||||||
$$ = $6;
|
$$ = $6;
|
||||||
scanner_set_location($1.filename,$1.line);
|
scanner_set_location($1.filename,$1.line+1);
|
||||||
if (strcmp($1.type,"include") == 0) set_nodeType($$,"include");
|
if (strcmp($1.type,"include") == 0) set_nodeType($$,"include");
|
||||||
if (strcmp($1.type,"import") == 0) {
|
if (strcmp($1.type,"import") == 0) {
|
||||||
mname = $2 ? Getattr($2,"module") : 0;
|
mname = $2 ? Getattr($2,"module") : 0;
|
||||||
|
|
|
||||||
|
|
@ -642,7 +642,6 @@ static String *get_filename(String *str, int *sysfile) {
|
||||||
String *fn;
|
String *fn;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
skip_whitespace(str, 0);
|
|
||||||
fn = NewStringEmpty();
|
fn = NewStringEmpty();
|
||||||
copy_location(str, fn);
|
copy_location(str, fn);
|
||||||
c = Getc(str);
|
c = Getc(str);
|
||||||
|
|
@ -668,9 +667,7 @@ static String *get_filename(String *str, int *sysfile) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static String *get_options(String *str) {
|
static String *get_options(String *str) {
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
skip_whitespace(str, 0);
|
|
||||||
c = Getc(str);
|
c = Getc(str);
|
||||||
if (c == '(') {
|
if (c == '(') {
|
||||||
String *opt;
|
String *opt;
|
||||||
|
|
@ -1648,8 +1645,8 @@ String *Preprocessor_parse(String *s) {
|
||||||
pop_imported();
|
pop_imported();
|
||||||
}
|
}
|
||||||
Delete(s2);
|
Delete(s2);
|
||||||
|
Delete(s1);
|
||||||
}
|
}
|
||||||
Delete(s1);
|
|
||||||
Delete(fn);
|
Delete(fn);
|
||||||
}
|
}
|
||||||
} else if (Equal(id, kpp_pragma)) {
|
} else if (Equal(id, kpp_pragma)) {
|
||||||
|
|
@ -1749,6 +1746,8 @@ String *Preprocessor_parse(String *s) {
|
||||||
/* Got some kind of file inclusion directive */
|
/* Got some kind of file inclusion directive */
|
||||||
if (allow) {
|
if (allow) {
|
||||||
DOH *s1, *s2, *fn, *opt;
|
DOH *s1, *s2, *fn, *opt;
|
||||||
|
String *options_whitespace = NewString("");
|
||||||
|
String *filename_whitespace = NewString("");
|
||||||
int sysfile = 0;
|
int sysfile = 0;
|
||||||
|
|
||||||
if (Equal(decl, kpp_dextern)) {
|
if (Equal(decl, kpp_dextern)) {
|
||||||
|
|
@ -1756,14 +1755,16 @@ String *Preprocessor_parse(String *s) {
|
||||||
Clear(decl);
|
Clear(decl);
|
||||||
Append(decl, "%%import");
|
Append(decl, "%%import");
|
||||||
}
|
}
|
||||||
|
skip_whitespace(s, options_whitespace);
|
||||||
opt = get_options(s);
|
opt = get_options(s);
|
||||||
|
skip_whitespace(s, filename_whitespace);
|
||||||
fn = get_filename(s, &sysfile);
|
fn = get_filename(s, &sysfile);
|
||||||
s1 = cpp_include(fn, sysfile);
|
s1 = cpp_include(fn, sysfile);
|
||||||
if (s1) {
|
if (s1) {
|
||||||
char *dirname;
|
char *dirname;
|
||||||
copy_location(s, chunk);
|
copy_location(s, chunk);
|
||||||
add_chunk(ns, chunk, allow);
|
add_chunk(ns, chunk, allow);
|
||||||
Printf(ns, "%sfile%s \"%s\" [\n", decl, opt, Swig_filename_escape(Swig_last_file()));
|
Printf(ns, "%sfile%s%s%s\"%s\" [\n", decl, options_whitespace, opt, filename_whitespace, Swig_filename_escape(Swig_last_file()));
|
||||||
if (Equal(decl, kpp_dimport)) {
|
if (Equal(decl, kpp_dimport)) {
|
||||||
push_imported();
|
push_imported();
|
||||||
}
|
}
|
||||||
|
|
@ -1787,6 +1788,8 @@ String *Preprocessor_parse(String *s) {
|
||||||
Delete(s1);
|
Delete(s1);
|
||||||
}
|
}
|
||||||
Delete(fn);
|
Delete(fn);
|
||||||
|
Delete(filename_whitespace);
|
||||||
|
Delete(options_whitespace);
|
||||||
}
|
}
|
||||||
state = 1;
|
state = 1;
|
||||||
} else if (Equal(decl, kpp_dline)) {
|
} else if (Equal(decl, kpp_dline)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue