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

Unified Diff: tools/lexer_generator/regex_lexer.py

Issue 59953002: Experimental lexer generator: parse {} in regexps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: rebased 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') | 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 1186069d452237f4e0e2bd077dba8ef907689c43..a2c98f7aa83e8be7742203d5fa58b454cde815ef 100644
--- a/tools/lexer_generator/regex_lexer.py
+++ b/tools/lexer_generator/regex_lexer.py
@@ -43,6 +43,11 @@ class RegexLexer:
'ZERO_OR_ONE',
'ANY',
+ 'REPEAT_BEGIN',
+ 'REPEAT_END',
+
+ 'NUMBER',
+ 'COMMA',
'LITERAL',
'RANGE',
@@ -64,11 +69,17 @@ class RegexLexer:
t_GROUP_BEGIN = r'\('
t_GROUP_END = r'\)'
+ t_REPEAT_BEGIN = r'\{'
+ t_REPEAT_END = r'\}'
+
t_OR = r'\|'
t_ONE_OR_MORE = r'\+'
t_ZERO_OR_MORE = r'\*'
t_ZERO_OR_ONE = r'\?'
+ t_NUMBER = r'[0-9]+'
+ t_COMMA = r','
+
t_ANY = r'\.'
t_LITERAL = r'.'
« no previous file with comments | « tools/lexer_generator/nfa.py ('k') | tools/lexer_generator/regex_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698