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 1801203002: Parser: Make skipping HTML comments optional. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. 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 explicit Scanner(UnicodeCache* scanner_contants); 343 Scanner(UnicodeCache* scanner_contants, bool allow_html_comments);
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_;
764 767
765 // Whether this scanner encountered an HTML comment. 768 // Whether this scanner encountered an HTML comment.
766 bool found_html_comment_; 769 bool found_html_comment_;
767 770
768 bool allow_harmony_exponentiation_operator_; 771 bool allow_harmony_exponentiation_operator_;
769 }; 772 };
770 773
771 } // namespace internal 774 } // namespace internal
772 } // namespace v8 775 } // namespace v8
773 776
774 #endif // V8_PARSING_SCANNER_H_ 777 #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