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

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

Issue 2009963002: [modules] Disable HTML-like comments Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unify behavior for optimized and non-optimized executions Created 4 years, 6 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 | « src/parsing/parser.cc ('k') | src/parsing/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_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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 342
343 int beg_pos; 343 int beg_pos;
344 int end_pos; 344 int end_pos;
345 }; 345 };
346 346
347 // -1 is outside of the range of any real source code. 347 // -1 is outside of the range of any real source code.
348 static const int kNoOctalLocation = -1; 348 static const int kNoOctalLocation = -1;
349 349
350 explicit Scanner(UnicodeCache* scanner_contants); 350 explicit Scanner(UnicodeCache* scanner_contants);
351 351
352 void Initialize(Utf16CharacterStream* source); 352 void Initialize(Utf16CharacterStream* source, bool allow_html_comments);
353 353
354 // Returns the next token and advances input. 354 // Returns the next token and advances input.
355 Token::Value Next(); 355 Token::Value Next();
356 // Returns the token following peek() 356 // Returns the token following peek()
357 Token::Value PeekAhead(); 357 Token::Value PeekAhead();
358 // Returns the current token again. 358 // Returns the current token again.
359 Token::Value current_token() { return current_.token; } 359 Token::Value current_token() { return current_.token; }
360 // Returns the location information for the current token 360 // Returns the location information for the current token
361 // (the token last returned by Next()). 361 // (the token last returned by Next()).
362 Location location() const { return current_.location; } 362 Location location() const { return current_.location; }
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 // inside multiline comments. 797 // inside multiline comments.
798 bool has_line_terminator_before_next_; 798 bool has_line_terminator_before_next_;
799 // Whether there is a multi-line comment that contains a 799 // Whether there is a multi-line comment that contains a
800 // line-terminator after the current token, and before the next. 800 // line-terminator after the current token, and before the next.
801 bool has_multiline_comment_before_next_; 801 bool has_multiline_comment_before_next_;
802 bool has_line_terminator_after_next_; 802 bool has_line_terminator_after_next_;
803 803
804 // Whether this scanner encountered an HTML comment. 804 // Whether this scanner encountered an HTML comment.
805 bool found_html_comment_; 805 bool found_html_comment_;
806 806
807 // Whether this scanner should interpret character sequences describing HTML
808 // comments as JavaScript comment delimiters (as per ES2015 section B.1.3,
809 // "HTML-like Comments")
810 bool allow_html_comments_;
811
807 bool allow_harmony_exponentiation_operator_; 812 bool allow_harmony_exponentiation_operator_;
808 813
809 MessageTemplate::Template scanner_error_; 814 MessageTemplate::Template scanner_error_;
810 Location scanner_error_location_; 815 Location scanner_error_location_;
811 }; 816 };
812 817
813 } // namespace internal 818 } // namespace internal
814 } // namespace v8 819 } // namespace v8
815 820
816 #endif // V8_PARSING_SCANNER_H_ 821 #endif // V8_PARSING_SCANNER_H_
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698