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

Unified Diff: tools/lexer_generator/generator.py

Issue 66313005: Experimental parser: better escaping (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 | « no previous file | tools/lexer_generator/regex_lexer.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 6137a7e386864a86076a0e58d564bb23f2828814..213ee6bab28c67a36564724c9695bea30ba4c5ee 100644
--- a/tools/lexer_generator/generator.py
+++ b/tools/lexer_generator/generator.py
@@ -88,11 +88,12 @@ def process_rules(parser_state):
if code:
graph = NfaBuilder.add_action(graph, (precedence, code, None))
if transition == 'continue':
- graph = NfaBuilder.add_continue(graph)
+ if not v['default'][1][2] == 'continue':
+ graph = NfaBuilder.add_continue(graph)
elif (transition == 'break' or
transition == 'terminate' or
transition == 'terminate_illegal'):
- pass
+ NfaBuilder.add_action(graph, (-1, transition, None))
else:
assert k == 'default'
graph = NfaBuilder.join_subgraph(graph, transition, rule_map[transition])
@@ -101,6 +102,9 @@ def process_rules(parser_state):
# merge default action
(precedence, code, transition) = v['default'][1]
assert transition == 'continue' or transition == 'break'
+ if transition == 'continue':
+ assert k != 'default'
+ # graph = NfaBuilder.apply_modifier('*', graph)
if code:
graph = NfaBuilder.add_incoming_action(graph, (precedence, code, None))
rule_map[k] = graph
« no previous file with comments | « no previous file | tools/lexer_generator/regex_lexer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698