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

Unified Diff: src/lexer/lexer_py.re

Issue 91123002: Experimental scanner: keep track of which strings / identifiers contain an escape. (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 | « src/lexer/experimental-scanner.h ('k') | tools/lexer_generator/code_generator.jinja » ('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 49c7cb5f0804371765d99ea0bb82aebd7de42807..fce1f68b5456a8762d274cbce9efa9568d70b2a9 100644
--- a/src/lexer/lexer_py.re
+++ b/src/lexer/lexer_py.re
@@ -196,9 +196,9 @@ default_action <do_token_and_go_forward(ILLEGAL)>
<<DoubleQuoteString>>
"\\" line_terminator_sequence <||continue>
-/\\[x][:hex_digit:]{2}/ <||continue>
-/\\[u][:hex_digit:]{4}/ <||continue>
-/\\[^xu:line_terminator:]/ <||continue>
+/\\[x][:hex_digit:]{2}/ <set_has_escapes||continue>
+/\\[u][:hex_digit:]{4}/ <set_has_escapes||continue>
+/\\[^xu:line_terminator:]/ <set_has_escapes||continue>
"\\" <|token(ILLEGAL)|>
line_terminator <|token(ILLEGAL)|>
"\"" <|token(STRING)|>
@@ -208,9 +208,9 @@ catch_all <||continue>
<<SingleQuoteString>>
# TODO subgraph for '\'
"\\" line_terminator_sequence <||continue>
-/\\[x][:hex_digit:]{2}/ <||continue>
-/\\[u][:hex_digit:]{4}/ <||continue>
-/\\[^xu:line_terminator:]/ <||continue>
+/\\[x][:hex_digit:]{2}/ <set_has_escapes||continue>
+/\\[u][:hex_digit:]{4}/ <set_has_escapes||continue>
+/\\[^xu:line_terminator:]/ <set_has_escapes||continue>
"\\" <|token(ILLEGAL)|>
line_terminator <|token(ILLEGAL)|>
"'" <|token(STRING)|>
@@ -223,6 +223,7 @@ identifier_char <|token(IDENTIFIER)|continue>
if (V8_UNLIKELY(!ValidIdentifierPart())) {
goto default_action;
}
+ next_.has_escapes = true;
}|token(IDENTIFIER)|continue>
<<SingleLineComment>>
« no previous file with comments | « src/lexer/experimental-scanner.h ('k') | tools/lexer_generator/code_generator.jinja » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698