Skip to content

Commit dd44fef

Browse files
committed
Allow explicit flag to be ignored in access_id
Needed on rare cases like the @ operator.
1 parent 175fae5 commit dd44fef

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/api/symboltable.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ def update_aliases(entry: SymbolVAR):
408408
for symbol in entry.aliased_by:
409409
symbol.alias = entry
410410

411-
def access_id(self, id_: str, lineno: int, scope=None, default_type=None, default_class=CLASS.unknown):
411+
def access_id(self, id_: str, lineno: int, scope=None, default_type=None, default_class=CLASS.unknown,
412+
ignore_explicit_flag=False):
412413
""" Access a symbol by its identifier and checks if it exists.
413414
If not, it's supposed to be an implicit declared variable.
414415
@@ -418,7 +419,7 @@ def access_id(self, id_: str, lineno: int, scope=None, default_type=None, defaul
418419
default_type = symbols.TYPEREF(default_type, lineno, implicit=False)
419420
assert default_type is None or isinstance(default_type, symbols.TYPEREF)
420421

421-
if not check.check_is_declared_explicit(lineno, id_):
422+
if not ignore_explicit_flag and not check.check_is_declared_explicit(lineno, id_):
422423
return None
423424

424425
result = self.get_entry(id_, scope)

0 commit comments

Comments
 (0)