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

Side by Side Diff: src/scanner.cc

Issue 1389313003: [parser] fix token end position for regexp literals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test Created 5 years, 2 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/mjsunit/es6/arrow-functions.js » ('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 "src/scanner.h" 7 #include "src/scanner.h"
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 LiteralScope literal(this); 1388 LiteralScope literal(this);
1389 while (c0_ >= 0 && unicode_cache_->IsIdentifierPart(c0_)) { 1389 while (c0_ >= 0 && unicode_cache_->IsIdentifierPart(c0_)) {
1390 if (c0_ != '\\') { 1390 if (c0_ != '\\') {
1391 AddLiteralCharAdvance(); 1391 AddLiteralCharAdvance();
1392 } else { 1392 } else {
1393 return false; 1393 return false;
1394 } 1394 }
1395 } 1395 }
1396 literal.Complete(); 1396 literal.Complete();
1397 1397
1398 next_.location.end_pos = source_pos() - 1; 1398 next_.location.end_pos = source_pos();
1399 return true; 1399 return true;
1400 } 1400 }
1401 1401
1402 1402
1403 const AstRawString* Scanner::CurrentSymbol(AstValueFactory* ast_value_factory) { 1403 const AstRawString* Scanner::CurrentSymbol(AstValueFactory* ast_value_factory) {
1404 if (is_literal_one_byte()) { 1404 if (is_literal_one_byte()) {
1405 return ast_value_factory->GetOneByteString(literal_one_byte_string()); 1405 return ast_value_factory->GetOneByteString(literal_one_byte_string());
1406 } 1406 }
1407 return ast_value_factory->GetTwoByteString(literal_two_byte_string()); 1407 return ast_value_factory->GetTwoByteString(literal_two_byte_string());
1408 } 1408 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); 1633 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u));
1634 } 1634 }
1635 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); 1635 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f));
1636 1636
1637 backing_store_.AddBlock(bytes); 1637 backing_store_.AddBlock(bytes);
1638 return backing_store_.EndSequence().start(); 1638 return backing_store_.EndSequence().start();
1639 } 1639 }
1640 1640
1641 } // namespace internal 1641 } // namespace internal
1642 } // namespace v8 1642 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/arrow-functions.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698