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

Side by Side Diff: src/scanner.cc

Issue 1127363002: [V8] Reland https://codereview.chromium.org/1121833003/ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Features shared by parsing and pre-parsing scanners. 5 // Features shared by parsing and pre-parsing scanners.
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 Token::ILLEGAL, 229 Token::ILLEGAL,
230 Token::LBRACE, // 0x7b 230 Token::LBRACE, // 0x7b
231 Token::ILLEGAL, 231 Token::ILLEGAL,
232 Token::RBRACE, // 0x7d 232 Token::RBRACE, // 0x7d
233 Token::BIT_NOT, // 0x7e 233 Token::BIT_NOT, // 0x7e
234 Token::ILLEGAL 234 Token::ILLEGAL
235 }; 235 };
236 236
237 237
238 Token::Value Scanner::Next() { 238 Token::Value Scanner::Next() {
239 if (next_.token == Token::EOS) {
240 next_.location.beg_pos = current_.location.beg_pos;
241 next_.location.end_pos = current_.location.end_pos;
242 }
239 current_ = next_; 243 current_ = next_;
240 has_line_terminator_before_next_ = false; 244 has_line_terminator_before_next_ = false;
241 has_multiline_comment_before_next_ = false; 245 has_multiline_comment_before_next_ = false;
242 if (static_cast<unsigned>(c0_) <= 0x7f) { 246 if (static_cast<unsigned>(c0_) <= 0x7f) {
243 Token::Value token = static_cast<Token::Value>(one_char_tokens[c0_]); 247 Token::Value token = static_cast<Token::Value>(one_char_tokens[c0_]);
244 if (token != Token::ILLEGAL) { 248 if (token != Token::ILLEGAL) {
245 int pos = source_pos(); 249 int pos = source_pos();
246 next_.token = token; 250 next_.token = token;
247 next_.location.beg_pos = pos; 251 next_.location.beg_pos = pos;
248 next_.location.end_pos = pos + 1; 252 next_.location.end_pos = pos + 1;
(...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 } 1624 }
1621 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); 1625 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u));
1622 } 1626 }
1623 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); 1627 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f));
1624 1628
1625 backing_store_.AddBlock(bytes); 1629 backing_store_.AddBlock(bytes);
1626 return backing_store_.EndSequence().start(); 1630 return backing_store_.EndSequence().start();
1627 } 1631 }
1628 1632
1629 } } // namespace v8::internal 1633 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698