diff --git a/CHANGES.current b/CHANGES.current index 115a1b511..d875740a5 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -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 diff --git a/Examples/test-suite/errors/c_extra_rblock.stderr b/Examples/test-suite/errors/c_extra_rblock.stderr index 82877023a..be14eee4c 100644 --- a/Examples/test-suite/errors/c_extra_rblock.stderr +++ b/Examples/test-suite/errors/c_extra_rblock.stderr @@ -1 +1 @@ -c_extra_rblock.i:5: Error: Syntax error in input(1). +c_extra_rblock.i:5: Error: Syntax error. Extraneous '%}' diff --git a/Source/Swig/scanner.c b/Source/Swig/scanner.c index d8c3f7f3f..b0d608c9e 100644 --- a/Source/Swig/scanner.c +++ b/Source/Swig/scanner.c @@ -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;