Reviewers: marja,

Message:
Committed patchset #1 manually as r17732.

Description:
Experimental parser: fix up action_type display

[email protected]

BUG=

Committed: https://code.google.com/p/v8/source/detail?r=17732

Please review this at https://codereview.chromium.org/66163014/

SVN Base: https://v8.googlecode.com/svn/branches/experimental/parser

Affected files (+5, -3 lines):
  M tools/lexer_generator/automaton.py
  M tools/lexer_generator/code_generator.py


Index: tools/lexer_generator/automaton.py
diff --git a/tools/lexer_generator/automaton.py b/tools/lexer_generator/automaton.py index 1ed580c4ea75105fa47f2824d4da39fc24f474fe..e0f1165dfb5429f2a87f56ff41497e0aeb2398e4 100644
--- a/tools/lexer_generator/automaton.py
+++ b/tools/lexer_generator/automaton.py
@@ -137,8 +137,9 @@ class Automaton(object):
       if node.action():
         action = node.action()
         if action.type() == 'code':
-          # assert action.data()
           action_text = action.data()
+        elif action.type() == 'push_token':
+          action_text = "token(" + action.data() + ")"
         else:
           action_text = action.type()
         action_text = escape(action_text)
Index: tools/lexer_generator/code_generator.py
diff --git a/tools/lexer_generator/code_generator.py b/tools/lexer_generator/code_generator.py index 87cb2ab742757b98e8db1179d54ab112eb6369a1..598c562701cf7ce8b3bfcec37175b1135b6f7c8e 100644
--- a/tools/lexer_generator/code_generator.py
+++ b/tools/lexer_generator/code_generator.py
@@ -92,8 +92,9 @@ code_%s:
         code += '%s\nBACK();\ngoto code_%s;\n' % (action.data(),
                                                   start_node_number)
       elif action.type() == 'push_token':
-        #TODO
-        pass
+        content = 'PUSH_TOKEN(Token::%s);' % action.data()
+        code += '%s\nBACK();\ngoto code_%s;\n' % (content,
+                                                  start_node_number)
       else:
         raise Exception("unknown type %s" % action.type())
     else:


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to