Commit a8d54281 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix buggy recursive calls in global syntax checks

parent 2a038e00
...@@ -275,6 +275,6 @@ def _continuous_signal(symbol, recursive=True, **kwargs): ...@@ -275,6 +275,6 @@ def _continuous_signal(symbol, recursive=True, **kwargs):
return result return result
As in 7), also make sure that the parent symbol (here: state) can recursively As in 7), also make sure that the parent symbol (here: state) can recursively
parse the new children. parse the new child.
...@@ -697,10 +697,15 @@ class SDL_Scene(QtGui.QGraphicsScene, object): ...@@ -697,10 +697,15 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
msg_box.exec_() msg_box.exec_()
def global_syntax_check(self): def global_syntax_check(self, ignore=set()):
''' Parse each visible symbol in the current scene and its children ''' Parse each visible symbol in the current scene and its children
and check syntax using the parser ''' and check syntax using the parser
Use a mutable parameter to avoid recursion on already visited
scenes
'''
res = True res = True
reset = not ignore
ignore.add(self)
for each in self.visible_symb: for each in self.visible_symb:
errors = self.syntax_errors(each) errors = self.syntax_errors(each)
if errors: if errors:
...@@ -720,9 +725,11 @@ class SDL_Scene(QtGui.QGraphicsScene, object): ...@@ -720,9 +725,11 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
log_errors(self.messages_window, fmt, [], clearfirst=False) log_errors(self.messages_window, fmt, [], clearfirst=False)
for each in self.all_nested_scenes: for each in self.all_nested_scenes:
err = each.global_syntax_check() if each not in ignore:
if not err: if not each.global_syntax_check():
res = False res = False
if reset:
ignore.clear()
return res return res
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment