Improve error message when an unknown SWIG directive is used
This previously gave the cryptic "Error: Syntax error in input(1).", but now gives "Error: Unknown directive '%foo'."
This commit is contained in:
parent
9ca6f78b07
commit
04715f74e2
6 changed files with 29 additions and 2 deletions
|
|
@ -1510,7 +1510,11 @@ declaration : swig_directive { $$ = $1; }
|
|||
| SEMI { $$ = 0; }
|
||||
| error {
|
||||
$$ = 0;
|
||||
Swig_error(cparse_file, cparse_line,"Syntax error in input(1).\n");
|
||||
if (cparse_unknown_directive) {
|
||||
Swig_error(cparse_file, cparse_line, "Unknown directive '%s'.\n", cparse_unknown_directive);
|
||||
} else {
|
||||
Swig_error(cparse_file, cparse_line, "Syntax error in input(1).\n");
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
/* Out of class constructor/destructor declarations */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue