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

Unified Diff: tools/lexer_generator/code_generator.jinja

Issue 137063007: Experimental parser: make marker local (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 | « src/lexer/experimental-scanner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/code_generator.jinja
diff --git a/tools/lexer_generator/code_generator.jinja b/tools/lexer_generator/code_generator.jinja
index 77ae4742fb92f54972df27ebe2e4acddf2669e5b..75d95b0c412807a6b803898bcaf049ad6d242f6c 100644
--- a/tools/lexer_generator/code_generator.jinja
+++ b/tools/lexer_generator/code_generator.jinja
@@ -72,7 +72,7 @@
{% if type == 'store_token' %}
stored_token = Token::{{value}};
{% elif type == 'set_marker' %}
- marker_ = cursor_ - {{value}};
+ marker = cursor_ - {{value}};
{% elif type == 'set_has_escapes' %}
next_.has_escapes = true;
{% elif type == 'octal_inside_string' %}
@@ -101,7 +101,7 @@
{% if type == 'terminate' %}
{{dispatch_match_action('backtrack', ('1', 'EOS'))}}
{% elif type == 'terminate_illegal' %}
- start_ = marker_;
+ start_ = marker;
{{dispatch_match_action('backtrack', ('1', 'ILLEGAL'))}}
{% elif type == 'skip' %}
RESET_START();
@@ -322,6 +322,7 @@ void ExperimentalScanner<{{char_type}}>::Scan() {
// Setup environment.
next_.has_escapes = false;
Token::Value stored_token;
+ const {{char_type}} * marker;
{{char_type}} primary_char;
READ_CURSOR();
@@ -343,6 +344,8 @@ void ExperimentalScanner<{{char_type}}>::Scan() {
if (false) {
// force use of stored_token
stored_token = Token::ILLEGAL;
+ // force use of marker
+ marker = NULL;
// force use of state_entry_0
goto state_entry_0;
}
« no previous file with comments | « src/lexer/experimental-scanner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698