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

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: Removed prefix; set default only on v8::ScriptOrigin constructor. 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
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 ignore_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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 // One Unicode character look-ahead; c0_ < 0 at the end of the input. 748 // One Unicode character look-ahead; c0_ < 0 at the end of the input.
749 uc32 c0_; 749 uc32 c0_;
750 750
751 // Whether there is a line terminator whitespace character after 751 // Whether there is a line terminator whitespace character after
752 // the current token, and before the next. Does not count newlines 752 // the current token, and before the next. Does not count newlines
753 // inside multiline comments. 753 // inside multiline comments.
754 bool has_line_terminator_before_next_; 754 bool has_line_terminator_before_next_;
755 // Whether there is a multi-line comment that contains a 755 // Whether there is a multi-line comment that contains a
756 // line-terminator after the current token, and before the next. 756 // line-terminator after the current token, and before the next.
757 bool has_multiline_comment_before_next_; 757 bool has_multiline_comment_before_next_;
758 // Whether to skip HTML comments (or report them as errors).
759 bool ignore_html_comments_;
758 760
759 // Whether this scanner encountered an HTML comment. 761 // Whether this scanner encountered an HTML comment.
760 bool found_html_comment_; 762 bool found_html_comment_;
761 }; 763 };
762 764
763 } // namespace internal 765 } // namespace internal
764 } // namespace v8 766 } // namespace v8
765 767
766 #endif // V8_PARSING_SCANNER_H_ 768 #endif // V8_PARSING_SCANNER_H_
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/scanner.cc » ('j') | src/parsing/scanner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698