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

Unified Diff: src/lexer/lexer_py.re

Issue 172893003: Experimental parser: add dfa path iterator (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 | « no previous file | tools/lexer_generator/backtracking_generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lexer/lexer_py.re
diff --git a/src/lexer/lexer_py.re b/src/lexer/lexer_py.re
index ac4da01a06060c37556e3717d035035cec689d51..eb8225a7e35b8fde9b3aba99b3baeaaff5abce7a 100644
--- a/src/lexer/lexer_py.re
+++ b/src/lexer/lexer_py.re
@@ -142,8 +142,8 @@ harmony_number "\\" <|token(ILLEGAL)|>
line_terminator+ <|line_terminator|>
/[:whitespace:]+/ <|skip|>
-"\"" <set_marker(1)||DoubleQuoteString>
-"'" <set_marker(1)||SingleQuoteString>
+"\"" <set_marker(1)|token(ILLEGAL)|DoubleQuoteString>
+"'" <set_marker(1)|token(ILLEGAL)|SingleQuoteString>
# all keywords
"break" <|token(BREAK)|>
@@ -192,11 +192,12 @@ line_terminator+ <|line_terminator|>
"with" <|token(WITH)|>
"yield" <|token(YIELD)|>
-identifier_start <|token(IDENTIFIER)|Identifier>
-unicode_escape <check_escaped_identifier_start|token(IDENTIFIER)|Identifier>
+identifier_start <|token(IDENTIFIER)|Identifier>
+unicode_escape <check_escaped_identifier_start|token(IDENTIFIER)|Identifier>
+"\\" <|token(ILLEGAL)|> # ambiguous backtracking otherwise
eos <terminate>
-default_action <do_token_and_go_forward(ILLEGAL)>
+default_action <default>
<<DoubleQuoteString>>
epsilon <StringSubgraph>
@@ -222,8 +223,9 @@ unicode_escape <set_has_escapes||continue(1)>
line_terminator <|token(ILLEGAL)|>
<<Identifier>>
-identifier_char <|token(IDENTIFIER)|continue>
-/\\u[:hex_digit:]{4}/ <check_escaped_identifier_part|token(IDENTIFIER)|continue>
+identifier_char <|token(IDENTIFIER)|continue>
+unicode_escape <check_escaped_identifier_part|token(IDENTIFIER)|continue>
+"\\" <|token(ILLEGAL)|> # ambiguous backtracking otherwise
<<SingleLineComment>>
line_terminator <|line_terminator|>
@@ -232,7 +234,6 @@ eos <skip_and_terminate>
<<MultiLineComment>>
/\*+\// <|skip|>
-# TODO(dcarney): find a way to generate the below rule
/\*+[^\/*]/ <||continue>
line_terminator <line_terminator_in_multiline_comment||continue>
catch_all <||continue>
« no previous file with comments | « no previous file | tools/lexer_generator/backtracking_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698