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

Side by Side Diff: src/parsing/scanner.cc

Issue 2119763003: Recognize HTMLCloseComment after multiline comment (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add more test cases Created 4 years, 5 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-parsing.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 "src/parsing/scanner.h" 7 #include "src/parsing/scanner.h"
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 } else { 557 } else {
558 token = Token::ADD; 558 token = Token::ADD;
559 } 559 }
560 break; 560 break;
561 561
562 case '-': 562 case '-':
563 // - -- --> -= 563 // - -- --> -=
564 Advance(); 564 Advance();
565 if (c0_ == '-') { 565 if (c0_ == '-') {
566 Advance(); 566 Advance();
567 if (c0_ == '>' && has_line_terminator_before_next_) { 567 if (c0_ == '>' && HasAnyLineTerminatorBeforeNext()) {
568 // For compatibility with SpiderMonkey, we skip lines that 568 // For compatibility with SpiderMonkey, we skip lines that
569 // start with an HTML comment end '-->'. 569 // start with an HTML comment end '-->'.
570 token = SkipSingleLineComment(); 570 token = SkipSingleLineComment();
571 } else { 571 } else {
572 token = Token::DEC; 572 token = Token::DEC;
573 } 573 }
574 } else if (c0_ == '=') { 574 } else if (c0_ == '=') {
575 token = Select(Token::ASSIGN_SUB); 575 token = Select(Token::ASSIGN_SUB);
576 } else { 576 } else {
577 token = Token::SUB; 577 token = Token::SUB;
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); 1705 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u));
1706 } 1706 }
1707 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); 1707 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f));
1708 1708
1709 backing_store_.AddBlock(bytes); 1709 backing_store_.AddBlock(bytes);
1710 return backing_store_.EndSequence().start(); 1710 return backing_store_.EndSequence().start();
1711 } 1711 }
1712 1712
1713 } // namespace internal 1713 } // namespace internal
1714 } // namespace v8 1714 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698