Fix garbage line number and empty file name reporting for some '}' or ')' error messages
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13976 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6dd4f362b3
commit
093dc60d2d
6 changed files with 32 additions and 2 deletions
|
|
@ -103,10 +103,11 @@ void start_inline(char *text, int line) {
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void skip_balanced(int startchar, int endchar) {
|
||||
int start_line = Scanner_line(scan);
|
||||
Clear(scanner_ccode);
|
||||
|
||||
if (Scanner_skip_balanced(scan,startchar,endchar) < 0) {
|
||||
Swig_error(Scanner_file(scan),Scanner_errline(scan), "Missing '%c'. Reached end of input.\n", endchar);
|
||||
Swig_error(cparse_file, start_line, "Missing '%c'. Reached end of input.\n", endchar);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ Scanner *NewScanner(void) {
|
|||
s->text = NewStringEmpty();
|
||||
s->str = 0;
|
||||
s->error = 0;
|
||||
s->error_line = 0;
|
||||
s->freeze_line = 0;
|
||||
return s;
|
||||
}
|
||||
|
|
@ -104,6 +105,12 @@ void Scanner_clear(Scanner * s) {
|
|||
s->nexttoken = -1;
|
||||
s->start_line = 0;
|
||||
s->yylen = 0;
|
||||
/* Should these be cleared too?
|
||||
s->idstart;
|
||||
s->file;
|
||||
s->error_line;
|
||||
s->freeze_line;
|
||||
*/
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue