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

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

Issue 88203002: Experimental scanner += API which takes Handle<String>. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Code review (ulan, dcarney) 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
« src/lexer/experimental-scanner.h ('K') | « tools/gyp/v8.gyp ('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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 {%- endif -%} 129 {%- endif -%}
130 {%- endmacro -%} 130 {%- endmacro -%}
131 131
132 132
133 {%- macro long_char_create() -%} 133 {%- macro long_char_create() -%}
134 {%- if encoding == 'utf16'-%} 134 {%- if encoding == 'utf16'-%}
135 const uint32_t long_char = primary_char; 135 const uint32_t long_char = primary_char;
136 {%- elif encoding == 'utf8'-%} 136 {%- elif encoding == 'utf8'-%}
137 unsigned bytes_read = 0; 137 unsigned bytes_read = 0;
138 const uint32_t long_char = unibrow::Utf8::CalculateValue( 138 const uint32_t long_char = unibrow::Utf8::CalculateValue(
139 reinterpret_cast<uint8_t*>(cursor_), 139 reinterpret_cast<const uint8_t*>(cursor_),
140 buffer_end_ - cursor_, 140 buffer_end_ - cursor_,
141 &bytes_read); 141 &bytes_read);
142 cursor_ += bytes_read - 1; 142 cursor_ += bytes_read - 1;
143 if (long_char == unibrow::Utf8::kBadChar) goto default_action; 143 if (long_char == unibrow::Utf8::kBadChar) goto default_action;
144 {%- else -%} 144 {%- else -%}
145 uncompilable code for {{encoding}} 145 uncompilable code for {{encoding}}
146 {%- endif -%} 146 {%- endif -%}
147 {%- endmacro -%} 147 {%- endmacro -%}
148 148
149 149
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 FORWARD(); 311 FORWARD();
312 goto code_start; 312 goto code_start;
313 313
314 fell_through: 314 fell_through:
315 ((void(*)())0)(); // crash 315 ((void(*)())0)(); // crash
316 // force use of stored_token 316 // force use of stored_token
317 stored_token = Token::ILLEGAL; 317 stored_token = Token::ILLEGAL;
318 } 318 }
319 } } 319 } }
320 320
OLDNEW
« src/lexer/experimental-scanner.h ('K') | « tools/gyp/v8.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698