Skip to content

Commit

Permalink
updated for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
konankisa committed Oct 10, 2023
1 parent 1daefeb commit 32e0e4e
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions vscode-antimony/src/server/stibium/stibium/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,6 @@ def handle_assignment(self, scope: AbstractScope, assignment: Assignment, insert
if functions.is_reserved_name(assignment.get_name_text()):
self.table.error.append(ReservedName(assignment.get_name().range, assignment.get_name_text()))
return
if type(assignment.get_value()) == FuncCall:
self.handle_function_call(scope, assignment.get_value(), insert)
return
if assignment.get_maybein() != None and assignment.get_maybein().is_in_comp():
comp = assignment.get_maybein().get_comp().get_name_text()
if insert:
Expand Down Expand Up @@ -1197,24 +1194,15 @@ def handle_mmodel_call(self, scope: AbstractScope, mmodel_call: ModularModelCall

def handle_function_call(self, scope: AbstractScope, function_call: FunctionCall, insert: bool):
comp = None
func_name = function_call.get_function_name().get_name()
if functions.is_reserved_name(func_name.text):
if insert:
self.import_table.insert(QName(scope, func_name), SymbolType.Function,
value_node=function_call, comp=comp)
else:
self.table.insert(QName(scope, func_name), SymbolType.Function,
value_node=function_call, comp=comp)
func_name = function_call.get_name()
if function_call.get_maybein() != None and function_call.get_maybein().is_in_comp():
comp = function_call.get_maybein().get_comp().get_name_text()
if insert:
self.import_table.insert(QName(scope, func_name), SymbolType.Parameter,
value_node=function_call, comp=comp)
else:
func_name = function_call.get_name()
if function_call.get_maybein() != None and function_call.get_maybein().is_in_comp():
comp = function_call.get_maybein().get_comp().get_name_text()
if insert:
self.import_table.insert(QName(scope, func_name), SymbolType.Parameter,
self.table.insert(QName(scope, func_name), SymbolType.Parameter,
value_node=function_call, comp=comp)
else:
self.table.insert(QName(scope, func_name), SymbolType.Parameter,
value_node=function_call, comp=comp)

def handle_variable_in(self, scope: AbstractScope, variable_in: VariableIn, insert: bool):
name = variable_in.get_name().get_name()
Expand Down

0 comments on commit 32e0e4e

Please sign in to comment.