Skip to content

Commit 85464f6

Browse files
authored
Merge pull request #391 from boriel/bugfix/include
Fix wrong include name file
2 parents 8b7352b + bc60096 commit 85464f6

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

api/symboltable.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ def check_is_declared(self, id_: str, lineno: int, classname='identifier',
218218

219219
if result is None or not result.declared:
220220
if show_error:
221-
syntax_error(lineno, 'Undeclared %s "%s"' % (classname, id_))
221+
syntax_error(lineno, 'Undeclared %s "%s"' % (classname, id_),
222+
fname=(result.filename if result is not None else None))
222223
return False
223224
return True
224225

tests/functional/include_error.bas

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
REM should shouw the original (included) filename, not this one
2+
3+
#include "llb.bas"

tests/functional/test_errmsg.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,6 @@ dim_at_label6.bas:3: error: Circular dependency between 'c' and 'b'
158158
dim_at_label7.bas:3: error: Circular dependency between 'b' and 'a'
159159
dim_at_label7.bas:3: error: Circular dependency between 'a' and 'c'
160160
dim_at_label7.bas:4: error: Circular dependency between 'c' and 'b'
161+
>>> process_file('include_error.bas')
162+
llb.bas:3: error: Undeclared function "f$"
161163

0 commit comments

Comments
 (0)