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

Unified Diff: tools/lexer_generator/regex_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/automata_test.py ('k') | tools/lexer_generator/rule_lexer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/regex_lexer.py
diff --git a/tools/lexer_generator/regex_lexer.py b/tools/lexer_generator/regex_lexer.py
index 26c44870b807d2c68282ccda9fc59516206647ce..bd25b7b24f3d14428a55e97f57ad2287fd698d46 100644
--- a/tools/lexer_generator/regex_lexer.py
+++ b/tools/lexer_generator/regex_lexer.py
@@ -85,15 +85,15 @@ class RegexLexer:
t_class_RANGE = '-'
t_class_NOT = '\^'
- t_class_CHARACTER_CLASS = ':ws:|:lit:'
+ t_class_CHARACTER_CLASS = r':\w+:'
def t_class_ESCAPED_CLASS_LITERAL(self, t):
- r'\\\^|\\-|\\\[|\\\]\\:'
+ r'\\\^|\\-|\\\[|\\\]|\\\:|\\\w'
t.type = 'CLASS_LITERAL'
t.value = t.value[1:]
return t
- t_class_CLASS_LITERAL = r'[a-zA-Z0-9]' # fix this
+ t_class_CLASS_LITERAL = r'[\w $_:+]' # fix this
t_ANY_ignore = '\n'
« no previous file with comments | « tools/lexer_generator/automata_test.py ('k') | tools/lexer_generator/rule_lexer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698