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

Side by Side Diff: src/lexer/experimental-scanner.h

Issue 136793025: Experimental lexer: track one-byteness on the fly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: cancel changes in ex scanner cc Created 6 years, 11 months 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 | tools/lexer_generator/code_generator.jinja » ('j') | 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 return literal.length() == keyword.length() && 231 return literal.length() == keyword.length() &&
232 (memcmp(literal.start(), keyword.start(), literal.length()) == 0); 232 (memcmp(literal.start(), keyword.start(), literal.length()) == 0);
233 } 233 }
234 234
235 protected: 235 protected:
236 struct TokenDesc { 236 struct TokenDesc {
237 Token::Value token; 237 Token::Value token;
238 int beg_pos; 238 int beg_pos;
239 int end_pos; 239 int end_pos;
240 bool has_escapes; 240 bool has_escapes;
241 bool is_onebyte;
241 }; 242 };
242 243
243 struct LiteralDesc { 244 struct LiteralDesc {
244 int beg_pos; 245 int beg_pos;
245 bool is_ascii; 246 bool is_ascii;
246 int length; 247 int length;
247 Vector<const char> ascii_string; 248 Vector<const char> ascii_string;
248 Vector<const uc16> utf16_string; 249 Vector<const uc16> utf16_string;
249 LiteralBuffer buffer; 250 LiteralBuffer buffer;
250 LiteralDesc() : beg_pos(-1), is_ascii(false), length(0) { } 251 LiteralDesc() : beg_pos(-1), is_ascii(false), length(0) { }
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 // character. 607 // character.
607 const Char* temp_cursor = last_octal_end_ - 1; 608 const Char* temp_cursor = last_octal_end_ - 1;
608 while (temp_cursor >= buffer_ && *temp_cursor >= '0' && *temp_cursor <= '7') 609 while (temp_cursor >= buffer_ && *temp_cursor >= '0' && *temp_cursor <= '7')
609 --temp_cursor; 610 --temp_cursor;
610 return Location(temp_cursor - buffer_ + 1, last_octal_end_ - buffer_); 611 return Location(temp_cursor - buffer_ + 1, last_octal_end_ - buffer_);
611 } 612 }
612 613
613 } } 614 } }
614 615
615 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H 616 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H
OLDNEW
« no previous file with comments | « no previous file | tools/lexer_generator/code_generator.jinja » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698