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

Side by Side Diff: src/scanner.h

Issue 1472323002: [es6] Correct parsing of regular expression literal flags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix oversight in interpreter Created 5 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
« no previous file with comments | « src/runtime/runtime-regexp.cc ('k') | src/scanner.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 #ifndef V8_SCANNER_H_ 7 #ifndef V8_SCANNER_H_
8 #define V8_SCANNER_H_ 8 #define V8_SCANNER_H_
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 // Returns true if there was a line terminator before the peek'ed token, 438 // Returns true if there was a line terminator before the peek'ed token,
439 // possibly inside a multi-line comment. 439 // possibly inside a multi-line comment.
440 bool HasAnyLineTerminatorBeforeNext() const { 440 bool HasAnyLineTerminatorBeforeNext() const {
441 return has_line_terminator_before_next_ || 441 return has_line_terminator_before_next_ ||
442 has_multiline_comment_before_next_; 442 has_multiline_comment_before_next_;
443 } 443 }
444 444
445 // Scans the input as a regular expression pattern, previous 445 // Scans the input as a regular expression pattern, previous
446 // character(s) must be /(=). Returns true if a pattern is scanned. 446 // character(s) must be /(=). Returns true if a pattern is scanned.
447 bool ScanRegExpPattern(bool seen_equal); 447 bool ScanRegExpPattern(bool seen_equal);
448 // Returns true if regexp flags are scanned (always since flags can 448 // Scans the input as regular expression flags. Returns the flags on success.
449 // be empty). 449 Maybe<RegExp::Flags> ScanRegExpFlags();
450 bool ScanRegExpFlags();
451 450
452 // Scans the input as a template literal 451 // Scans the input as a template literal
453 Token::Value ScanTemplateStart(); 452 Token::Value ScanTemplateStart();
454 Token::Value ScanTemplateContinuation(); 453 Token::Value ScanTemplateContinuation();
455 454
456 const LiteralBuffer* source_url() const { return &source_url_; } 455 const LiteralBuffer* source_url() const { return &source_url_; }
457 const LiteralBuffer* source_mapping_url() const { 456 const LiteralBuffer* source_mapping_url() const {
458 return &source_mapping_url_; 457 return &source_mapping_url_;
459 } 458 }
460 459
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 bool has_line_terminator_before_next_; 762 bool has_line_terminator_before_next_;
764 // Whether there is a multi-line comment that contains a 763 // Whether there is a multi-line comment that contains a
765 // line-terminator after the current token, and before the next. 764 // line-terminator after the current token, and before the next.
766 bool has_multiline_comment_before_next_; 765 bool has_multiline_comment_before_next_;
767 }; 766 };
768 767
769 } // namespace internal 768 } // namespace internal
770 } // namespace v8 769 } // namespace v8
771 770
772 #endif // V8_SCANNER_H_ 771 #endif // V8_SCANNER_H_
OLDNEW
« no previous file with comments | « src/runtime/runtime-regexp.cc ('k') | src/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698