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

Unified Diff: tools/lexer_generator/regex_parser.py

Issue 64053002: Experimental parser: fixup unit tests (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 | « no previous file | 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/regex_parser.py
diff --git a/tools/lexer_generator/regex_parser.py b/tools/lexer_generator/regex_parser.py
index 1d2ff388670e35273700daf53151cf583124bc94..c508cb35f5ab636ac23ee97c9adb10306c9e8fa9 100644
--- a/tools/lexer_generator/regex_parser.py
+++ b/tools/lexer_generator/regex_parser.py
@@ -135,7 +135,7 @@ class RegexParser:
'empty :'
def p_error(self, p):
- raise Exception("Syntax error in input '%s'" % p)
+ raise Exception("Syntax error in input '%s'" % str(p))
@staticmethod
def __cat(left, right):
@@ -156,4 +156,8 @@ class RegexParser:
parser = RegexParser()
parser.build()
RegexParser.__static_instance = parser
- return parser.parser.parse(data, lexer=parser.lexer.lexer)
+ try:
+ return parser.parser.parse(data, lexer=parser.lexer.lexer)
+ except Exception as e:
+ RegexParser.__static_instance = None
+ raise e
« no previous file with comments | « no previous file | tools/lexer_generator/rule_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698