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

Unified Diff: tools/lexer_generator/generator.py

Issue 68343006: Experimental parser: add break instruction (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/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 f96019543e31171ef43d4361d6494dbecca266f3..7f929cd14bfd7e1b508ddf977c43ea81bb40793f 100644
--- a/tools/lexer_generator/generator.py
+++ b/tools/lexer_generator/generator.py
@@ -96,11 +96,14 @@ class Generator(object):
action = code if code else default_code
if action:
graph = NfaBuilder.add_action(graph, (precedence, action))
- if transition == 'continue':
+ if not transition:
+ pass
+ elif transition == 'continue':
assert not k == 'default'
graph = NfaBuilder.add_continue(graph)
elif transition == 'break':
- pass
+ assert code
+ graph = NfaBuilder.add_break(graph)
elif (transition == 'terminate' or
transition == 'terminate_illegal'):
assert not code
« no previous file with comments | « no previous file | tools/lexer_generator/nfa.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698