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

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: Update attribute/method name Created 4 years, 7 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 467
468 const LiteralBuffer* source_url() const { return &source_url_; } 468 const LiteralBuffer* source_url() const { return &source_url_; }
469 const LiteralBuffer* source_mapping_url() const { 469 const LiteralBuffer* source_mapping_url() const {
470 return &source_mapping_url_; 470 return &source_mapping_url_;
471 } 471 }
472 472
473 bool IdentifierIsFutureStrictReserved(const AstRawString* string) const; 473 bool IdentifierIsFutureStrictReserved(const AstRawString* string) const;
474 474
475 bool FoundHtmlComment() const { return found_html_comment_; } 475 bool FoundHtmlComment() const { return found_html_comment_; }
476 476
477 void set_allow_html_comments(bool allow) { allow_html_comments_ = allow; }
478
477 #define DECLARE_ACCESSORS(name) \ 479 #define DECLARE_ACCESSORS(name) \
478 inline bool allow_##name() const { return allow_##name##_; } \ 480 inline bool allow_##name() const { return allow_##name##_; } \
479 inline void set_allow_##name(bool allow) { allow_##name##_ = allow; } 481 inline void set_allow_##name(bool allow) { allow_##name##_ = allow; }
480 DECLARE_ACCESSORS(harmony_exponentiation_operator) 482 DECLARE_ACCESSORS(harmony_exponentiation_operator)
481 #undef ACCESSOR 483 #undef ACCESSOR
482 484
483 private: 485 private:
484 // The current and look-ahead token. 486 // The current and look-ahead token.
485 struct TokenDesc { 487 struct TokenDesc {
486 Token::Value token; 488 Token::Value token;
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 // inside multiline comments. 799 // inside multiline comments.
798 bool has_line_terminator_before_next_; 800 bool has_line_terminator_before_next_;
799 // Whether there is a multi-line comment that contains a 801 // Whether there is a multi-line comment that contains a
800 // line-terminator after the current token, and before the next. 802 // line-terminator after the current token, and before the next.
801 bool has_multiline_comment_before_next_; 803 bool has_multiline_comment_before_next_;
802 bool has_line_terminator_after_next_; 804 bool has_line_terminator_after_next_;
803 805
804 // Whether this scanner encountered an HTML comment. 806 // Whether this scanner encountered an HTML comment.
805 bool found_html_comment_; 807 bool found_html_comment_;
806 808
809 // Whether this scanner should recognize HTML-like comment tokens.
vogelheim 2016/05/27 08:08:49 Please be clear on what this does. As I read the
mike3 2016/05/27 15:53:22 Yes, you are right. I'm afraid I applied Adam's fe
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

Powered by Google App Engine
This is Rietveld 408576698