| 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_PARSING_SCANNER_H_ | 7 #ifndef V8_PARSING_SCANNER_H_ | 
| 8 #define V8_PARSING_SCANNER_H_ | 8 #define V8_PARSING_SCANNER_H_ | 
| 9 | 9 | 
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" | 
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 318   // Scans the input as a regular expression pattern, next token must be /(=). | 318   // Scans the input as a regular expression pattern, next token must be /(=). | 
| 319   // Returns true if a pattern is scanned. | 319   // Returns true if a pattern is scanned. | 
| 320   bool ScanRegExpPattern(); | 320   bool ScanRegExpPattern(); | 
| 321   // Scans the input as regular expression flags. Returns the flags on success. | 321   // Scans the input as regular expression flags. Returns the flags on success. | 
| 322   Maybe<RegExp::Flags> ScanRegExpFlags(); | 322   Maybe<RegExp::Flags> ScanRegExpFlags(); | 
| 323 | 323 | 
| 324   // Scans the input as a template literal | 324   // Scans the input as a template literal | 
| 325   Token::Value ScanTemplateStart(); | 325   Token::Value ScanTemplateStart(); | 
| 326   Token::Value ScanTemplateContinuation(); | 326   Token::Value ScanTemplateContinuation(); | 
| 327 | 327 | 
| 328   Handle<String> SourceUrl(Isolate* isolate) const { | 328   Handle<String> SourceUrl(Isolate* isolate) const; | 
| 329     Handle<String> tmp; | 329   Handle<String> SourceMappingUrl(Isolate* isolate) const; | 
| 330     if (source_url_.length() > 0) tmp = source_url_.Internalize(isolate); |  | 
| 331     return tmp; |  | 
| 332   } |  | 
| 333 |  | 
| 334   Handle<String> SourceMappingUrl(Isolate* isolate) const { |  | 
| 335     Handle<String> tmp; |  | 
| 336     if (source_mapping_url_.length() > 0) |  | 
| 337       tmp = source_mapping_url_.Internalize(isolate); |  | 
| 338     return tmp; |  | 
| 339   } |  | 
| 340 | 330 | 
| 341   bool FoundHtmlComment() const { return found_html_comment_; } | 331   bool FoundHtmlComment() const { return found_html_comment_; } | 
| 342 | 332 | 
| 343  private: | 333  private: | 
| 344   // Scoped helper for saving & restoring scanner error state. | 334   // Scoped helper for saving & restoring scanner error state. | 
| 345   // This is used for tagged template literals, in which normally forbidden | 335   // This is used for tagged template literals, in which normally forbidden | 
| 346   // escape sequences are allowed. | 336   // escape sequences are allowed. | 
| 347   class ErrorState; | 337   class ErrorState; | 
| 348 | 338 | 
| 349   // Scoped helper for literal recording. Automatically drops the literal | 339   // Scoped helper for literal recording. Automatically drops the literal | 
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 778   bool found_html_comment_; | 768   bool found_html_comment_; | 
| 779 | 769 | 
| 780   MessageTemplate::Template scanner_error_; | 770   MessageTemplate::Template scanner_error_; | 
| 781   Location scanner_error_location_; | 771   Location scanner_error_location_; | 
| 782 }; | 772 }; | 
| 783 | 773 | 
| 784 }  // namespace internal | 774 }  // namespace internal | 
| 785 }  // namespace v8 | 775 }  // namespace v8 | 
| 786 | 776 | 
| 787 #endif  // V8_PARSING_SCANNER_H_ | 777 #endif  // V8_PARSING_SCANNER_H_ | 
| OLD | NEW | 
|---|