Chromium Code Reviews| Index: src/parsing/scanner.cc |
| diff --git a/src/parsing/scanner.cc b/src/parsing/scanner.cc |
| index 2d5a57958336ef1ec4bb65b8ce63da1efc199a3e..8a6522e52796932a5f0acb1ce76e8be89fedfd71 100644 |
| --- a/src/parsing/scanner.cc |
| +++ b/src/parsing/scanner.cc |
| @@ -36,10 +36,11 @@ void Utf16CharacterStream::ResetToBookmark() { UNREACHABLE(); } |
| // ---------------------------------------------------------------------------- |
| // Scanner |
| -Scanner::Scanner(UnicodeCache* unicode_cache) |
| +Scanner::Scanner(UnicodeCache* unicode_cache, bool ignore_html_comments) |
| : unicode_cache_(unicode_cache), |
| bookmark_c0_(kNoBookmark), |
| octal_pos_(Location::invalid()), |
| + ignore_html_comments_(ignore_html_comments), |
| found_html_comment_(false) { |
| bookmark_current_.literal_chars = &bookmark_current_literal_; |
| bookmark_current_.raw_literal_chars = &bookmark_current_raw_literal_; |
| @@ -483,7 +484,7 @@ void Scanner::Scan() { |
| token = Select(Token::LTE); |
| } else if (c0_ == '<') { |
| token = Select('=', Token::ASSIGN_SHL, Token::SHL); |
| - } else if (c0_ == '!') { |
| + } else if (c0_ == '!' && ignore_html_comments_) { |
|
rossberg
2016/03/18 13:14:07
So "skip" == "ignore" == do parse? That is confusi
vogelheim
2016/03/18 13:56:01
Done.
Yeah, I struggled with the naming... I like
|
| token = ScanHtmlComment(); |
| } else { |
| token = Token::LT; |