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

Unified Diff: tools/lexer_generator/rule_parser.py

Issue 62223002: Experimental lexer generator: transfer actions across epsilon transitions correctly when constructi… (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: code review (dcarney) 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 | « tools/lexer_generator/nfa.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/rule_parser.py
diff --git a/tools/lexer_generator/rule_parser.py b/tools/lexer_generator/rule_parser.py
index 215e06df62cb84179ecf807d4990ca804db6e46d..9dc0b4e9672f14e89e71e797c3c075c80e517361 100644
--- a/tools/lexer_generator/rule_parser.py
+++ b/tools/lexer_generator/rule_parser.py
@@ -47,6 +47,7 @@ class RuleParserState:
class RuleParser:
tokens = RuleLexer.tokens
+ __rule_precedence_counter = 0
def __init__(self):
self.__state = None
@@ -95,7 +96,8 @@ class RuleParser:
| composite_regex_or_default empty action
| composite_regex_or_default code empty'''
rules = self.__state.rules[self.__state.current_state]
- rule = (p[1], p[2], p[3])
+ rule = (p[1], RuleParser.__rule_precedence_counter, p[2], p[3])
+ RuleParser.__rule_precedence_counter += 1
if p[1] == 'default':
assert not rules['default']
rules['default'] = rule
« no previous file with comments | « tools/lexer_generator/nfa.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698