When reporting an error for a construct which hasn't been terminated
when the end of the file is reached, report it at the start line rather than "EOF" as then tools like editors and IDEs will take you to a generally more useful place for fixing the problem.
This commit is contained in:
parent
51487c1acc
commit
ce90ff6a77
10 changed files with 28 additions and 13 deletions
|
|
@ -1 +1 @@
|
|||
pp_missing_enddef.i:EOF: Error: Missing %enddef for macro starting on line 3
|
||||
pp_missing_enddef.i:3: Error: Missing %enddef for macro starting here
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
pp_missing_endif.i:EOF: Error: Missing #endif for conditional starting on line 3
|
||||
pp_missing_endif.i:3: Error: Missing #endif for conditional starting here
|
||||
|
|
|
|||
7
Examples/test-suite/errors/pp_missing_endoffile.i
Normal file
7
Examples/test-suite/errors/pp_missing_endoffile.i
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
%module xxx
|
||||
/* %beginfile and %endoffile are internal directives inserted when %include is
|
||||
* used. Users should never use them directly, but test coverage for this
|
||||
* error message still seems useful to have.
|
||||
*/
|
||||
%includefile "dummy.i" %beginfile
|
||||
|
||||
1
Examples/test-suite/errors/pp_missing_endoffile.stderr
Normal file
1
Examples/test-suite/errors/pp_missing_endoffile.stderr
Normal file
|
|
@ -0,0 +1 @@
|
|||
pp_missing_endoffile.i:6: Error: Missing %endoffile for file inclusion block starting here
|
||||
|
|
@ -1 +1 @@
|
|||
pp_missing_rblock.i:EOF: Error: Unterminated %{ ... %} block starting on line 3
|
||||
pp_missing_rblock.i:3: Error: Unterminated %{ ... %} block
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
pp_unterm_char.i:EOF: Error: Unterminated character constant starting at line 4
|
||||
pp_unterm_char.i:4: Error: Unterminated character constant
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
pp_unterm_comment.i:EOF: Error: Unterminated comment starting on line 3
|
||||
pp_unterm_comment.i:3: Error: Unterminated comment
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
pp_unterm_string.i:EOF: Error: Unterminated string constant starting at line 4
|
||||
pp_unterm_string.i:4: Error: Unterminated string constant
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue