Improve error message for extraneous '%}'.

This commit is contained in:
Olly Betts 2015-01-08 12:47:12 +13:00
commit 51487c1acc
3 changed files with 7 additions and 1 deletions

View file

@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 3.0.4 (in progress)
===========================
2015-01-08: olly
Improve error message for extraneous '%}'.
2015-01-08: olly
Improve error message when an unknown SWIG directive is used - this
previously gave the cryptic "Error: Syntax error in input(1).", but

View file

@ -1 +1 @@
c_extra_rblock.i:5: Error: Syntax error in input(1).
c_extra_rblock.i:5: Error: Syntax error. Extraneous '%}'

View file

@ -824,6 +824,9 @@ static int look(Scanner *s) {
state = 7;
} else if (c == '=') {
return SWIG_TOKEN_MODEQUAL;
} else if (c == '}') {
Swig_error(cparse_file, cparse_line, "Syntax error. Extraneous '%%}'\n");
exit(1);
} else {
retract(s, 1);
return SWIG_TOKEN_PERCENT;