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

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

Issue 1817163003: Revert of Parser: Make skipping HTML comments optional. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 static Location invalid() { return Location(-1, -1); } 334 static Location invalid() { return Location(-1, -1); }
335 335
336 int beg_pos; 336 int beg_pos;
337 int end_pos; 337 int end_pos;
338 }; 338 };
339 339
340 // -1 is outside of the range of any real source code. 340 // -1 is outside of the range of any real source code.
341 static const int kNoOctalLocation = -1; 341 static const int kNoOctalLocation = -1;
342 342
343 Scanner(UnicodeCache* scanner_contants, bool allow_html_comments); 343 explicit Scanner(UnicodeCache* scanner_contants);
344 344
345 void Initialize(Utf16CharacterStream* source); 345 void Initialize(Utf16CharacterStream* source);
346 346
347 // Returns the next token and advances input. 347 // Returns the next token and advances input.
348 Token::Value Next(); 348 Token::Value Next();
349 // Returns the token following peek() 349 // Returns the token following peek()
350 Token::Value PeekAhead(); 350 Token::Value PeekAhead();
351 // Returns the current token again. 351 // Returns the current token again.
352 Token::Value current_token() { return current_.token; } 352 Token::Value current_token() { return current_.token; }
353 // Returns the location information for the current token 353 // Returns the location information for the current token
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 // One Unicode character look-ahead; c0_ < 0 at the end of the input. 754 // One Unicode character look-ahead; c0_ < 0 at the end of the input.
755 uc32 c0_; 755 uc32 c0_;
756 756
757 // Whether there is a line terminator whitespace character after 757 // Whether there is a line terminator whitespace character after
758 // the current token, and before the next. Does not count newlines 758 // the current token, and before the next. Does not count newlines
759 // inside multiline comments. 759 // inside multiline comments.
760 bool has_line_terminator_before_next_; 760 bool has_line_terminator_before_next_;
761 // Whether there is a multi-line comment that contains a 761 // Whether there is a multi-line comment that contains a
762 // line-terminator after the current token, and before the next. 762 // line-terminator after the current token, and before the next.
763 bool has_multiline_comment_before_next_; 763 bool has_multiline_comment_before_next_;
764 // Whether to allow HTML comments (that is, skip over them, rather than
765 // reporting the comment marker as a sequence of tokens.)
766 bool allow_html_comments_;
767 764
768 // Whether this scanner encountered an HTML comment. 765 // Whether this scanner encountered an HTML comment.
769 bool found_html_comment_; 766 bool found_html_comment_;
770 767
771 bool allow_harmony_exponentiation_operator_; 768 bool allow_harmony_exponentiation_operator_;
772 }; 769 };
773 770
774 } // namespace internal 771 } // namespace internal
775 } // namespace v8 772 } // namespace v8
776 773
777 #endif // V8_PARSING_SCANNER_H_ 774 #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