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

Unified Diff: tools/lexer_generator/code_generator.py

Issue 152823002: Experimental parser: use sentinal values for actions (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 11 months 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 | « tools/lexer_generator/automaton.py ('k') | tools/lexer_generator/dfa.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 6bc44eb8da20905171050a6d350727dd3ed122da..96a26f473d52c1024265af92d0bbafc934f49d18 100644
--- a/tools/lexer_generator/code_generator.py
+++ b/tools/lexer_generator/code_generator.py
@@ -61,8 +61,8 @@ class CodeGenerator:
def __transform_state(encoding, state):
# action data
action = state.action()
- entry_action = None if not action else action.entry_action()
- match_action = None if not action else action.match_action()
+ entry_action = action.entry_action()
+ match_action = action.match_action()
# generate ordered transitions
transitions = map(lambda (k, v) : (k, v.node_number()),
state.transitions().items())
@@ -297,8 +297,7 @@ class CodeGenerator:
goto_map = {}
states = self.__dfa_states
for state in states:
- if (state['match_action'] and
- state['match_action'].name() == 'do_stored_token'):
+ if (state['match_action'].name() == 'do_stored_token'):
assert not state['match_action'].args()[0] in goto_map
goto_map[state['match_action'].args()[0]] = state['node_number']
mapped_actions = set([
« no previous file with comments | « tools/lexer_generator/automaton.py ('k') | tools/lexer_generator/dfa.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698