This commit is contained in:
deadsmond 2019-11-25 20:13:04 +01:00
parent c394833efe
commit 82cd75137a

View File

@ -60,9 +60,13 @@ class automata:
if self.graph[q]:
# search through all its connections to find value
for transition in self.graph[q]:
if transition[i]:
# append next node
result.append(transition[i])
try:
if transition[i]:
# append next node
result.append(transition[i])
except KeyError:
# there is no value like that (element from the outside of alphabet)
return []
# return list of next nodes
return result