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

Unified Diff: tools/lexer_generator/rule_lexer.py

Issue 135053003: Experimental parser: remove inline code from lexer rules (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/code_generator_test.py ('k') | tools/lexer_generator/rule_parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/rule_lexer.py
diff --git a/tools/lexer_generator/rule_lexer.py b/tools/lexer_generator/rule_lexer.py
index 62df8139af21a112469c1cb5c89f9c8c638606e8..51744afb916ea52fd7f67eb393598e308d7f373e 100644
--- a/tools/lexer_generator/rule_lexer.py
+++ b/tools/lexer_generator/rule_lexer.py
@@ -51,20 +51,10 @@ class RuleLexer:
'ACTION_OPEN',
'ACTION_CLOSE',
- 'LEFT_BRACKET',
- 'RIGHT_BRACKET',
-
- 'CODE_FRAGMENT',
-
'COMMA',
)
- states = (
- ('code','exclusive'),
- )
-
t_ignore = " \t\n\r"
- t_code_ignore = ""
def t_COMMENT(self, t):
r'\#.*[\n\r]+'
@@ -103,23 +93,6 @@ class RuleLexer:
self.nesting = 1
return t
- t_code_CODE_FRAGMENT = r'[^{}]+'
-
- def t_code_LEFT_BRACKET(self, t):
- r'{'
- self.nesting += 1
- t.type = 'CODE_FRAGMENT'
- return t
-
- def t_code_RIGHT_BRACKET(self, t):
- r'}'
- self.nesting -= 1
- if self.nesting:
- t.type = 'CODE_FRAGMENT'
- else:
- self.lexer.pop_state()
- return t
-
def t_ANY_error(self, t):
raise Exception("Illegal character '%s'" % t.value[0])
« no previous file with comments | « tools/lexer_generator/code_generator_test.py ('k') | tools/lexer_generator/rule_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698