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

Unified Diff: tools/lexer_generator/code_generator.py

Issue 63773003: Experimental parser: add push_token syntax (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/rule_lexer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/code_generator.py
diff --git a/tools/lexer_generator/code_generator.py b/tools/lexer_generator/code_generator.py
index ff118d2cd6defdced68cf984eaa32f74b0f498af..87cb2ab742757b98e8db1179d54ab112eb6369a1 100644
--- a/tools/lexer_generator/code_generator.py
+++ b/tools/lexer_generator/code_generator.py
@@ -88,8 +88,14 @@ code_%s:
''' % s.node_number()
if action:
- code += '%s\nBACK();\ngoto code_%s;\n' % (action.data(),
- start_node_number)
+ if action.type() == 'code':
+ code += '%s\nBACK();\ngoto code_%s;\n' % (action.data(),
+ start_node_number)
+ elif action.type() == 'push_token':
+ #TODO
+ pass
+ else:
+ raise Exception("unknown type %s" % action.type())
else:
code += 'goto default_action;'
return code
« no previous file with comments | « src/lexer/lexer_py.re ('k') | tools/lexer_generator/rule_lexer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698