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

Unified Diff: tools/lexer_generator/code_generator.jinja

Issue 136793025: Experimental lexer: track one-byteness on the fly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: cancel changes in ex scanner cc 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 67ccb56a3d60b5670a40d3597e98589d77d0e041..d5951785a978d6089a7aa543d996e0b35b41c502 100644
--- a/tools/lexer_generator/code_generator.jinja
+++ b/tools/lexer_generator/code_generator.jinja
@@ -105,6 +105,9 @@
{{dispatch_match_action('backtrack', ('1', 'ILLEGAL'))}}
{% elif type == 'skip' %}
RESET_START();
+ {%- if encoding == 'utf16'-%}
+ next_.is_onebyte = true;
+ {%- endif -%}
goto state_entry_0;
{% elif type == 'skip_and_terminate' %}
RESET_START();
@@ -112,6 +115,9 @@
{{dispatch_match_action('terminate', None)}}
{% elif type == 'line_terminator' %}
RESET_START();
+ {%- if encoding == 'utf16'-%}
+ next_.is_onebyte = true;
+ {%- endif -%}
has_line_terminator_before_next_ = true;
goto state_entry_0;
{% elif type == 'token' %}
@@ -264,6 +270,7 @@
{%- if state['long_char_transitions'] -%}
if ({{long_char_check()}}) {
+ next_.is_onebyte = false;
{{long_char_create()}}
{%- for key, transition_state_id in state['long_char_transitions'] %}
if ({{do_key(key)}}) { // long_char transition
@@ -323,6 +330,7 @@ void ExperimentalScanner<{{char_type}}>::Scan() {
// Setup environment.
next_.has_escapes = false;
+ next_.is_onebyte = true;
Token::Value stored_token;
const {{char_type}} * marker;
{{char_type}} primary_char;
« 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