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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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 eb265a8f7e54352c9832499ff2eea335c26b38a2..1675355480c6454cd35be5bd8ab911c67bc4cf55 100644
--- a/tools/lexer_generator/code_generator.jinja
+++ b/tools/lexer_generator/code_generator.jinja
@@ -6,7 +6,15 @@
{%- for r in key.range_iter() -%}
{%- if not loop.first %} || {% endif -%}
{%- if r[0] == 'LATIN_1' -%}
- ({{r[1][0]}} <= yych && yych <= {{r[1][1]}})
+ {%- if r[1][0] == r[1][1] -%}
+ yych == {{r[1][0]}}
+ {%- elif r[1][0] == 0 -%}
+ yych <= {{r[1][1]}}
+ {%- elif r[1][1] == 255 -%}
+ yych >= {{r[1][0]}}
+ {%- else -%}
+ ({{r[1][0]}} <= yych && yych <= {{r[1][1]}})
+ {%- endif -%}
{%- else -%}
false
{%- endif -%}
« 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