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

Unified Diff: tools/lexer_generator/rule_lexer.py

Issue 59603003: Experimental parser: parsing regex subexpressions (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 | « tools/lexer_generator/regex_lexer.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 05bf03a0d5201b248fac3ea8a6eb2a5c43de3ef2..ae5c8bb57dfb745c48eb9fd2794db7a5b22134d8 100644
--- a/tools/lexer_generator/rule_lexer.py
+++ b/tools/lexer_generator/rule_lexer.py
@@ -31,7 +31,8 @@ class RuleLexer:
tokens = (
'IDENTIFIER',
- 'STRING_REGEX',
+ 'STRING',
+ 'REGEX',
'CHARACTER_CLASS_REGEX',
'TRANSITION',
'TRANSITION_WITH_CODE',
@@ -65,7 +66,8 @@ class RuleLexer:
pass
t_IDENTIFIER = r'[a-zA-Z0-9_]+'
- t_STRING_REGEX = r'"((\\("|\w|\\))|[^\\"])+"'
+ t_STRING = r'"((\\("|\w|\\))|[^\\"])+"'
+ t_REGEX = r'/[^\/]+/'
t_CHARACTER_CLASS_REGEX = r'\[([^\]]|\\\])+\]'
t_TRANSITION = r':=>'
t_TRANSITION_WITH_CODE = r'=>'
« no previous file with comments | « tools/lexer_generator/regex_lexer.py ('k') | tools/lexer_generator/rule_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698