semantic: make unused variables print a warning instead of raising an error
This commit is contained in:
parent
fcf0b9c12d
commit
76cdfc0b5f
1 changed files with 2 additions and 2 deletions
|
|
@ -229,8 +229,8 @@ class Context:
|
||||||
|
|
||||||
# Check for unused variables
|
# Check for unused variables
|
||||||
if len(variable.reads) == 0 and variable.definition is not None:
|
if len(variable.reads) == 0 and variable.definition is not None:
|
||||||
raise SemanticAnalysisError(variable.definition.location(),
|
CompilationWarning(variable.definition.location(),
|
||||||
message=f"Variable '{variable.name}' is unused")
|
message=f"Variable '{variable.name}' is unused").raise_warning()
|
||||||
|
|
||||||
for context in self.child_contexts.values():
|
for context in self.child_contexts.values():
|
||||||
context.check()
|
context.check()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue