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

Update the State autocompletion list

parent 89214105
......@@ -251,7 +251,6 @@ class Symbol(QObject, QGraphicsPathItem, object):
import traceback
print traceback.print_stack()
raise TypeError('Use unicode() not str()')
#return str(self.text) or 'no_name'
def __unicode__(self):
''' Return the text inside the symbol '''
......
......@@ -570,7 +570,7 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
''' When text has changed on a symbol, update the data dictionnary '''
pr_text = '\n'.join(Pr.generate(symbol,
recursive=False,
nextstate=False))
nextstate=False, cpy=True))
symbol.update_completion_list(pr_text=pr_text)
def find_text(self, pattern):
......
......@@ -781,14 +781,15 @@ class State(VerticalSymbol):
def update_completion_list(self, pr_text):
''' When text was entered, update state completion list '''
# Get AST for the symbol
# Get AST for the symbol and update the context dictionnary
ast, _, _, _, _ = self.parser.parseSingleElement('state', pr_text)
#State.completion_list |= set(ast.statelist)
for each in ast.statelist:
CONTEXT.mapping[each] = None
@property
def completion_list(self):
''' Set auto-completion list '''
return (state for state in CONTEXT.mapping if state != 'START')
return set(state for state in CONTEXT.mapping if state != 'START')
def set_shape(self, width, height):
''' Compute the polygon to fit in width, height '''
......
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