Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1330)

Unified Diff: tools/lexer_generator/nfa.py

Issue 66493003: Experimental lexer generator: fix dfa generation when there are epsilon transitions with actions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/lexer_generator/lexer_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/nfa.py
diff --git a/tools/lexer_generator/nfa.py b/tools/lexer_generator/nfa.py
index fbd94ee2eef5e306dcafdcce9b23e970fab1d231..16eb5a280d6db47b76f7f65da37cf7f833ffe53c 100644
--- a/tools/lexer_generator/nfa.py
+++ b/tools/lexer_generator/nfa.py
@@ -399,6 +399,11 @@ class Nfa(Automaton):
for e_trans in state.transitions()[e]:
if e_trans[1]:
actions.append(e_trans[1])
+ for s in state.epsilon_closure():
+ if e in s.transitions():
+ for e_trans in s.transitions()[e]:
+ if e_trans[1]:
+ actions.append(e_trans[1])
assert len(match_states) == len(transitions)
« no previous file with comments | « tools/lexer_generator/lexer_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698