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

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

Issue 91833002: Experimental scanner: keeping track of octal numbers octal escapes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years 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 | « test/lexer/cornercases/strings-and-identifiers-with-escapes.js ('k') | 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 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 {% elif type == 'store_harmony_token_and_goto' %} 107 {% elif type == 'store_harmony_token_and_goto' %}
108 if (harmony_{{value[0]}}_) { 108 if (harmony_{{value[0]}}_) {
109 stored_token = Token::{{value[1]}}; 109 stored_token = Token::{{value[1]}};
110 } else { 110 } else {
111 stored_token = Token::{{value[2]}}; 111 stored_token = Token::{{value[2]}};
112 } 112 }
113 goto code_after_entry_{{value[3]}}; 113 goto code_after_entry_{{value[3]}};
114 {% elif type == 'set_marker' %} 114 {% elif type == 'set_marker' %}
115 marker_ = cursor_ - {{value}}; 115 marker_ = cursor_ - {{value}};
116 {% elif type == 'set_has_escapes' %} 116 {% elif type == 'set_has_escapes' %}
117 next_.has_escapes = true; 117 next_.has_escapes = true;
118 {% elif type == 'octal_number' %}
119 last_octal_end_ = cursor_;
120 DO_TOKEN(Token::NUMBER);
121 {% elif type == 'octal_inside_string' %}
122 last_octal_end_ = cursor_;
123 next_.has_escapes = true;
118 {% else %} 124 {% else %}
119 uncompilable code for {{type}} 125 uncompilable code for {{type}}
120 {% endif -%} 126 {% endif -%}
121 {%- endmacro -%} 127 {%- endmacro -%}
122 128
123 129
124 {%- macro long_char_check() -%} 130 {%- macro long_char_check() -%}
125 {%- if encoding == 'utf16'-%} 131 {%- if encoding == 'utf16'-%}
126 primary_char > {{upper_bound}} 132 primary_char > {{upper_bound}}
127 {%- elif encoding == 'utf8'-%} 133 {%- elif encoding == 'utf8'-%}
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 FORWARD(); 320 FORWARD();
315 goto code_start; 321 goto code_start;
316 322
317 fell_through: 323 fell_through:
318 ((void(*)())0)(); // crash 324 ((void(*)())0)(); // crash
319 // force use of stored_token 325 // force use of stored_token
320 stored_token = Token::ILLEGAL; 326 stored_token = Token::ILLEGAL;
321 } 327 }
322 } } 328 } }
323 329
OLDNEW
« no previous file with comments | « test/lexer/cornercases/strings-and-identifiers-with-escapes.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698