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

Unified Diff: tools/lexer_generator/regex_lexer.py

Issue 50293010: Experimental parser: parse character classes (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years, 2 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 | « no previous file | tools/lexer_generator/regex_parser.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 d45f202c054a04563d81aabbfb167685ff716f7a..26c44870b807d2c68282ccda9fc59516206647ce 100644
--- a/tools/lexer_generator/regex_lexer.py
+++ b/tools/lexer_generator/regex_lexer.py
@@ -48,6 +48,7 @@ class RegexLexer:
'RANGE',
'NOT',
'CLASS_LITERAL',
+ 'CHARACTER_CLASS',
)
states = (
@@ -84,9 +85,10 @@ class RegexLexer:
t_class_RANGE = '-'
t_class_NOT = '\^'
+ t_class_CHARACTER_CLASS = ':ws:|:lit:'
def t_class_ESCAPED_CLASS_LITERAL(self, t):
- r'\\\^|\\-|\\\[|\\\]'
+ r'\\\^|\\-|\\\[|\\\]\\:'
t.type = 'CLASS_LITERAL'
t.value = t.value[1:]
return t
« no previous file with comments | « no previous file | tools/lexer_generator/regex_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698