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

Unified Diff: src/lexer/lexer_py.re

Issue 135053003: Experimental parser: remove inline code from lexer rules (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 11 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/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 97dcc1bda6228394295aad0f74c798f1c5bdca1c..0b7ef3895bc7806ebda882f10edeef3c1a85bc09 100644
--- a/src/lexer/lexer_py.re
+++ b/src/lexer/lexer_py.re
@@ -54,7 +54,7 @@ eos = [:eos:];
# grammar is
# regex <action_on_state_entry|action_on_match|transition>
#
-# actions can be c code enclosed in {} or identifiers to be passed to codegen
+# actions are identifiers to be passed to codegen
# transition must be 'continue' or the name of a subgraph
<<default>>
@@ -79,25 +79,9 @@ eos = [:eos:];
"/*" <set_marker(2)||MultiLineComment>
"<!--" <||SingleLineComment>
-"<!-" <|{
- BACKWARD(2);
- DO_TOKEN(Token::LT);
- return;
-}|>
-
-"<!" <|{
- BACKWARD(1);
- DO_TOKEN(Token::LT);
- return;
-}|>
-
-"-->" <{
- if (!has_line_terminator_before_next_) {
- BACKWARD(1);
- DO_TOKEN(Token::DEC);
- return;
- }
-}||SingleLineComment>
+"<!-" <|backtrack(2, LT)|>
+"<!" <|backtrack(1, LT)|>
+"-->" <if_line_terminator_backtrack(1, DEC)||SingleLineComment>
">>>=" <|token(ASSIGN_SHR)|>
">>>" <|token(SHR)|>
@@ -200,12 +184,7 @@ line_terminator+ <|line_terminator|>
"yield" <|token(YIELD)|>
identifier_start <|token(IDENTIFIER)|Identifier>
-/\\u[:hex_digit:]{4}/ <{
- if (V8_UNLIKELY(!ValidIdentifierStart())) {
- goto default_action;
- }
- next_.has_escapes = true;
-}|token(IDENTIFIER)|Identifier>
+/\\u[:hex_digit:]{4}/ <check_escaped_identifier_start|token(IDENTIFIER)|Identifier>
eos <|terminate|>
default_action <do_token_and_go_forward(ILLEGAL)>
@@ -241,12 +220,7 @@ catch_all <||continue>
<<Identifier>>
identifier_char <|token(IDENTIFIER)|continue>
-/\\u[:hex_digit:]{4}/ <{
- if (V8_UNLIKELY(!ValidIdentifierPart())) {
- goto default_action;
- }
- next_.has_escapes = true;
-}|token(IDENTIFIER)|continue>
+/\\u[:hex_digit:]{4}/ <check_escaped_identifier_part|token(IDENTIFIER)|continue>
<<SingleLineComment>>
line_terminator <|line_terminator|>
« no previous file with comments | « no previous file | tools/lexer_generator/code_generator.jinja » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698