OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |