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

Side by Side Diff: tools/lexer_generator/code_generator.jinja

Issue 80263003: Experimental parser: split classes into latin1 and non latin1 (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/lexer/lexer_py.re ('k') | tools/lexer_generator/transition_keys.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "lexer/even-more-experimental-scanner.h" 1 #include "lexer/even-more-experimental-scanner.h"
2 2
3 {%- macro do_key(key) -%} 3 {%- macro do_key(key) -%}
4 {%- for r in key -%} 4 {%- for r in key -%}
5 {%- if not loop.first %} || {% endif -%} 5 {%- if not loop.first %} || {% endif -%}
6 {%- if r[0] == 'LATIN_1' -%} 6 {%- if r[0] == 'LATIN_1' -%}
7 {%- if r[1][0] == r[1][1] -%} 7 {%- if r[1][0] == r[1][1] -%}
8 » yych == {{r[1][0]}} 8 » yych == {{r[1][0]}}
9 {%- elif r[1][0] == 0 -%} 9 {%- elif r[1][0] == 0 -%}
10 » yych <= {{r[1][1]}} 10 » yych <= {{r[1][1]}}
11 {%- elif r[1][1] == 255 -%} 11 {%- elif r[1][1] == 255 -%}
12 » yych >= {{r[1][0]}} 12 » yych >= {{r[1][0]}}
13 {%- else -%} 13 {%- else -%}
14 » ({{r[1][0]}} <= yych && yych <= {{r[1][1]}}) 14 » ({{r[1][0]}} <= yych && yych <= {{r[1][1]}})
15 {%- endif -%} 15 {%- endif -%}
16 {%- elif r[0] == 'CLASS' -%} 16 {%- elif r[0] == 'CLASS' -%}
17 {%- if r[1] == 'eos' -%} 17 {%- if r[1] == 'eos' -%}
18 » (yych == 0 && cursor_ >= buffer_end_) 18 » (yych == 0 && cursor_ >= buffer_end_)
19 {%- elif r[1] == 'zero' -%} 19 {%- elif r[1] == 'zero' -%}
20 » (yych == 0 && cursor_ < buffer_end_) 20 » (yych == 0 && cursor_ < buffer_end_)
21 {%- elif r[1] == 'whitespace' and encoding == 'utf16'-%} 21 {%- elif r[1] == 'non_latin_1_whitespace' and encoding == 'utf16'-%}
22 {# FIXME: Add and use unicode_cache_->InNonAsciiWhitespace #} 22 {# FIXME: Add and use unicode_cache_->InNonAsciiWhitespace #}
23 (yych != ' ' && yych != '\t' && yych != '\v' && yych != '\f' && yych != '\r' && yych != '\n' && unicode_cache_->IsWhiteSpace(yych)) 23 (yych > 255 && unicode_cache_->IsWhiteSpace(yych))
24 {%- elif r[1] == 'letter' and encoding == 'utf16'-%} 24 {%- elif r[1] == 'non_latin_1_letter' and encoding == 'utf16'-%}
25 {# FIXME: Add and use unicode_cache_->InNonAsciiLetter #} 25 {# FIXME: Add and use unicode_cache_->InNonAsciiLetter #}
26 (!(yych >= 'a' && yych <= 'z') && !(yych >= 'A' && yych <= 'Z') && unic ode_cache_->IsLetter(yych)) 26 (yych > 255 && unicode_cache_->IsLetter(yych))
27 {%- elif r[1] == 'identifier_part_not_letter' and encoding == 'utf16'-%} 27 {%- elif r[1] == 'non_latin1_identifier_part_not_letter' and encoding == ' utf16'-%}
28 unicode_cache_->IsIdentifierPartNotLetter(yych) 28 (yych > 255 && unicode_cache_->IsIdentifierPartNotLetter(yych))
29 {%- elif r[1] == 'non_latin1_line_terminator' and encoding == 'utf16'-%}
30 (yych > 255 && unicode_cache_->IsLineTerminator(yych))
29 {%- else -%} 31 {%- else -%}
30 » false /* {{r[1]}} */ 32 » false /* {{r[1]}} */
31 {%- endif -%} 33 {%- endif -%}
32 {%- else -%} 34 {%- else -%}
33 false 35 false
34 {%- endif -%} 36 {%- endif -%}
35 {%- endfor -%} 37 {%- endfor -%}
36 {%- endmacro -%} 38 {%- endmacro -%}
37 39
38 40
39 {% macro dispatch_action(type, value) -%} 41 {% macro dispatch_action(type, value) -%}
40 {%- if type == 'code' %} 42 {%- if type == 'code' %}
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 {% endif -%} 204 {% endif -%}
203 {{dispatch_action(default_action[0], default_action[1])}} 205 {{dispatch_action(default_action[0], default_action[1])}}
204 FORWARD(); 206 FORWARD();
205 goto code_start; 207 goto code_start;
206 208
207 fell_through: 209 fell_through:
208 CHECK(false); 210 CHECK(false);
209 } 211 }
210 } } 212 } }
211 213
OLDNEW
« no previous file with comments | « src/lexer/lexer_py.re ('k') | tools/lexer_generator/transition_keys.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698