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

Unified Diff: src/lexer/lexer_py.re

Issue 91963002: Experimental scanner: End the octal position madness. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: work git cl work 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 | « src/lexer/lexer-shell.cc ('k') | no next file » | 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 df03fe7c758da990205bcd7ca61e11882da946a8..7b0cababf8e029f6b1530fb3957efe6bf815593a 100644
--- a/src/lexer/lexer_py.re
+++ b/src/lexer/lexer_py.re
@@ -198,11 +198,11 @@ eos <|terminate|>
default_action <do_token_and_go_forward(ILLEGAL)>
<<DoubleQuoteString>>
-"\\" line_terminator_sequence <||continue>
+"\\" line_terminator_sequence <set_has_escapes||continue>
/\\[x][:hex_digit:]{2}/ <set_has_escapes||continue>
/\\[u][:hex_digit:]{4}/ <set_has_escapes||continue>
/\\[1-7]/ <octal_inside_string||continue>
-/\\[0-7]{2,3}/ <octal_inside_string||continue>
+/\\[0-7][0-7]+/ <octal_inside_string||continue>
/\\[^xu1-7:line_terminator:]/ <set_has_escapes||continue>
"\\" <|token(ILLEGAL)|>
line_terminator <|token(ILLEGAL)|>
@@ -212,11 +212,11 @@ catch_all <||continue>
<<SingleQuoteString>>
# TODO subgraph for '\'
-"\\" line_terminator_sequence <||continue>
+"\\" line_terminator_sequence <set_has_escapes||continue>
/\\[x][:hex_digit:]{2}/ <set_has_escapes||continue>
/\\[u][:hex_digit:]{4}/ <set_has_escapes||continue>
/\\[1-7]/ <octal_inside_string||continue>
-/\\[0-7]{2,3}/ <octal_inside_string||continue>
+/\\[0-7][0-7]+/ <octal_inside_string||continue>
/\\[^xu1-7:line_terminator:]/ <set_has_escapes||continue>
"\\" <|token(ILLEGAL)|>
line_terminator <|token(ILLEGAL)|>
« no previous file with comments | « src/lexer/lexer-shell.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698