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

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

Issue 59673005: Experimental lexer generator: fix build errors (type-limits). (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 | « no previous file | no next file » | 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 3
4 // TODO implement CLASS checks 4 // TODO implement CLASS checks
5 {%- macro do_key(key) -%} 5 {%- macro do_key(key) -%}
6 {%- for r in key.range_iter() -%} 6 {%- for r in key.range_iter() -%}
7 {%- if not loop.first %} || {% endif -%} 7 {%- if not loop.first %} || {% endif -%}
8 {%- if r[0] == 'LATIN_1' -%} 8 {%- if r[0] == 'LATIN_1' -%}
9 ({{r[1][0]}} <= yych && yych <= {{r[1][1]}}) 9 {%- if r[1][0] == r[1][1] -%}
10 » yych == {{r[1][0]}}
11 {%- elif r[1][0] == 0 -%}
12 » yych <= {{r[1][1]}}
13 {%- elif r[1][1] == 255 -%}
14 » yych >= {{r[1][0]}}
15 {%- else -%}
16 » ({{r[1][0]}} <= yych && yych <= {{r[1][1]}})
17 {%- endif -%}
10 {%- else -%} 18 {%- else -%}
11 false 19 false
12 {%- endif -%} 20 {%- endif -%}
13 {%- endfor -%} 21 {%- endfor -%}
14 {%- endmacro -%} 22 {%- endmacro -%}
15 23
16 24
17 {% macro dispatch_action(type, value) -%} 25 {% macro dispatch_action(type, value) -%}
18 {%- if type == 'code' %} 26 {%- if type == 'code' %}
19 {{value}} 27 {{value}}
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 {{dispatch_action(default_action[0], default_action[1])}} 130 {{dispatch_action(default_action[0], default_action[1])}}
123 FORWARD(); 131 FORWARD();
124 goto code_start; 132 goto code_start;
125 return 0; 133 return 0;
126 134
127 fell_through: 135 fell_through:
128 CHECK(false); 136 CHECK(false);
129 } 137 }
130 } } 138 } }
131 139
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698