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

Unified Diff: test/cctest/test-parsing.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index d8e2aaed6cfe22f22018c64a2a66593d7433e8e1..276cc86bd340ef4485c721a644be9f36b640afcf 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -70,7 +70,7 @@
CHECK(static_cast<int>(sizeof(buffer)) >= length);
{
i::Utf8ToUtf16CharacterStream stream(keyword, length);
- i::Scanner scanner(&unicode_cache, false);
+ i::Scanner scanner(&unicode_cache);
scanner.Initialize(&stream);
CHECK_EQ(key_token.token, scanner.Next());
CHECK_EQ(i::Token::EOS, scanner.Next());
@@ -78,7 +78,7 @@
// Removing characters will make keyword matching fail.
{
i::Utf8ToUtf16CharacterStream stream(keyword, length - 1);
- i::Scanner scanner(&unicode_cache, false);
+ i::Scanner scanner(&unicode_cache);
scanner.Initialize(&stream);
CHECK_EQ(i::Token::IDENTIFIER, scanner.Next());
CHECK_EQ(i::Token::EOS, scanner.Next());
@@ -89,7 +89,7 @@
i::MemMove(buffer, keyword, length);
buffer[length] = chars_to_append[j];
i::Utf8ToUtf16CharacterStream stream(buffer, length + 1);
- i::Scanner scanner(&unicode_cache, false);
+ i::Scanner scanner(&unicode_cache);
scanner.Initialize(&stream);
CHECK_EQ(i::Token::IDENTIFIER, scanner.Next());
CHECK_EQ(i::Token::EOS, scanner.Next());
@@ -99,7 +99,7 @@
i::MemMove(buffer, keyword, length);
buffer[length - 1] = '_';
i::Utf8ToUtf16CharacterStream stream(buffer, length);
- i::Scanner scanner(&unicode_cache, false);
+ i::Scanner scanner(&unicode_cache);
scanner.Initialize(&stream);
CHECK_EQ(i::Token::IDENTIFIER, scanner.Next());
CHECK_EQ(i::Token::EOS, scanner.Next());
@@ -151,7 +151,7 @@
reinterpret_cast<const i::byte*>(tests[i]);
i::Utf8ToUtf16CharacterStream stream(source, i::StrLength(tests[i]));
i::CompleteParserRecorder log;
- i::Scanner scanner(CcTest::i_isolate()->unicode_cache(), false);
+ i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream);
i::Zone zone;
i::AstValueFactory ast_value_factory(
@@ -169,7 +169,7 @@
reinterpret_cast<const i::byte*>(fail_tests[i]);
i::Utf8ToUtf16CharacterStream stream(source, i::StrLength(fail_tests[i]));
i::CompleteParserRecorder log;
- i::Scanner scanner(CcTest::i_isolate()->unicode_cache(), false);
+ i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream);
i::Zone zone;
i::AstValueFactory ast_value_factory(
@@ -184,32 +184,6 @@
}
}
-TEST(ScanHtmlComments) {
- const char* src = "a <!-- b --> c";
- i::UnicodeCache unicode_cache;
-
- // Skip HTML comments:
- {
- i::Utf8ToUtf16CharacterStream stream(reinterpret_cast<const i::byte*>(src),
- i::StrLength(src));
- i::Scanner scanner(&unicode_cache, true);
- scanner.Initialize(&stream);
- CHECK_EQ(i::Token::IDENTIFIER, scanner.Next());
- CHECK_EQ(i::Token::EOS, scanner.Next());
- }
-
- // Parse (don't skip) HTML comments:
- {
- i::Utf8ToUtf16CharacterStream stream(reinterpret_cast<const i::byte*>(src),
- i::StrLength(src));
- i::Scanner scanner(&unicode_cache, false);
- scanner.Initialize(&stream);
- CHECK_EQ(i::Token::IDENTIFIER, scanner.Next());
- CHECK_EQ(i::Token::LT, scanner.Next());
- CHECK_EQ(i::Token::NOT, scanner.Next());
- CHECK_EQ(i::Token::DEC, scanner.Next());
- }
-}
class ScriptResource : public v8::String::ExternalOneByteStringResource {
public:
@@ -349,7 +323,7 @@
reinterpret_cast<const i::byte*>(program),
static_cast<unsigned>(strlen(program)));
i::CompleteParserRecorder log;
- i::Scanner scanner(CcTest::i_isolate()->unicode_cache(), false);
+ i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream);
i::Zone zone;
@@ -385,7 +359,7 @@
reinterpret_cast<const i::byte*>(program),
static_cast<unsigned>(strlen(program)));
i::CompleteParserRecorder log;
- i::Scanner scanner(CcTest::i_isolate()->unicode_cache(), false);
+ i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream);
// Preparser defaults to disallowing natives syntax.
@@ -456,7 +430,7 @@
reinterpret_cast<const i::byte*>(program),
static_cast<unsigned>(strlen(program)));
i::CompleteParserRecorder log;
- i::Scanner scanner(CcTest::i_isolate()->unicode_cache(), false);
+ i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream);
i::Zone zone;
i::AstValueFactory ast_value_factory(&zone,
@@ -491,7 +465,7 @@
i::Handle<i::String> source = factory->NewStringFromAsciiChecked(program);
i::GenericStringUtf16CharacterStream stream(source, 0, source->length());
i::CompleteParserRecorder log;
- i::Scanner scanner(CcTest::i_isolate()->unicode_cache(), false);
+ i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream);
i::Zone zone;
i::AstValueFactory ast_value_factory(&zone,
@@ -543,7 +517,7 @@
reinterpret_cast<const i::byte*>(program.get()),
static_cast<unsigned>(kProgramSize));
i::CompleteParserRecorder log;
- i::Scanner scanner(CcTest::i_isolate()->unicode_cache(), false);
+ i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream);
i::Zone zone;
@@ -773,7 +747,7 @@
i::Token::Value* expected_tokens,
int skip_pos = 0, // Zero means not skipping.
int skip_to = 0) {
- i::Scanner scanner(CcTest::i_isolate()->unicode_cache(), false);
+ i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(stream);
int i = 0;
@@ -856,7 +830,7 @@
reinterpret_cast<const i::byte*>(re_source),
static_cast<unsigned>(strlen(re_source)));
i::HandleScope scope(CcTest::i_isolate());
- i::Scanner scanner(CcTest::i_isolate()->unicode_cache(), false);
+ i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream);
i::Token::Value start = scanner.peek();
@@ -1576,7 +1550,7 @@
// Preparse the data.
i::CompleteParserRecorder log;
if (test_preparser) {
- i::Scanner scanner(isolate->unicode_cache(), false);
+ i::Scanner scanner(isolate->unicode_cache());
i::GenericStringUtf16CharacterStream stream(source, 0, source->length());
i::Zone zone;
i::AstValueFactory ast_value_factory(
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698