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

Unified Diff: tools/lexer_generator/generator.py

Issue 66533002: Experimental parser: better generation (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 | « src/lexer/lexer_py.re ('k') | tools/lexer_generator/nfa.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/generator.py
diff --git a/tools/lexer_generator/generator.py b/tools/lexer_generator/generator.py
index 213ee6bab28c67a36564724c9695bea30ba4c5ee..3305de229e056b6c1cddfb4baf74df5a8d67dd36 100644
--- a/tools/lexer_generator/generator.py
+++ b/tools/lexer_generator/generator.py
@@ -90,10 +90,12 @@ def process_rules(parser_state):
if transition == 'continue':
if not v['default'][1][2] == 'continue':
graph = NfaBuilder.add_continue(graph)
+ else:
+ pass # TODO null key
elif (transition == 'break' or
transition == 'terminate' or
transition == 'terminate_illegal'):
- NfaBuilder.add_action(graph, (-1, transition, None))
+ graph = NfaBuilder.add_action(graph, (10000, transition, None))
else:
assert k == 'default'
graph = NfaBuilder.join_subgraph(graph, transition, rule_map[transition])
@@ -104,7 +106,7 @@ def process_rules(parser_state):
assert transition == 'continue' or transition == 'break'
if transition == 'continue':
assert k != 'default'
- # graph = NfaBuilder.apply_modifier('*', graph)
+ graph = NfaBuilder.add_incoming_action(graph, (10000, k, None))
if code:
graph = NfaBuilder.add_incoming_action(graph, (precedence, code, None))
rule_map[k] = graph
« no previous file with comments | « src/lexer/lexer_py.re ('k') | tools/lexer_generator/nfa.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698