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

Unified Diff: tools/lexer_generator/regex_parser.py

Issue 157813004: Experimental parser: store literals as ints (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 10 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/nfa_builder.py ('k') | tools/lexer_generator/transition_key_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/regex_parser.py
diff --git a/tools/lexer_generator/regex_parser.py b/tools/lexer_generator/regex_parser.py
index d74a3e8d9b76b941ce8e9376f9d1b720d29e76d0..9c86a0b927f7742982d0f213d13f1ce37ebc9975 100644
--- a/tools/lexer_generator/regex_parser.py
+++ b/tools/lexer_generator/regex_parser.py
@@ -238,7 +238,7 @@ class RegexParser:
def p_literal(self, p):
'''literal : LITERAL'''
- p[0] = Term('LITERAL', p[1])
+ p[0] = Term('LITERAL', ord(p[1]))
def p_any(self, p):
'''any : ANY'''
@@ -262,10 +262,10 @@ class RegexParser:
| CHARACTER_CLASS maybe_class_content
'''
if len(p) == 5:
- left = Term("RANGE", p[1], p[3])
+ left = Term("RANGE", ord(p[1]), ord(p[3]))
else:
if len(p[1]) == 1:
- left = Term('LITERAL', p[1])
+ left = Term('LITERAL', ord(p[1]))
else:
left = Term('CHARACTER_CLASS', p[1][1:-1])
p[0] = self.__cat(left, p[len(p)-1])
« no previous file with comments | « tools/lexer_generator/nfa_builder.py ('k') | tools/lexer_generator/transition_key_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698