tint: rename template argument token strings
Drop the `(opening|closing template argument list)` bit. It makes for messy diagnostics.
Change-Id: I92d29ece8a012362dd16da297089aab908571415
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117213
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/reader/wgsl/parser_impl_error_msg_test.cc b/src/tint/reader/wgsl/parser_impl_error_msg_test.cc
index ce36288..f458834 100644
--- a/src/tint/reader/wgsl/parser_impl_error_msg_test.cc
+++ b/src/tint/reader/wgsl/parser_impl_error_msg_test.cc
@@ -120,9 +120,8 @@
}
TEST_F(ParserImplErrorTest, BitcastExprMissingLessThan) {
- EXPECT(
- "fn f() { x = bitcast(y); }",
- R"(test.wgsl:1:21 error: expected '< (opening template argument list)' for bitcast expression
+ EXPECT("fn f() { x = bitcast(y); }",
+ R"(test.wgsl:1:21 error: expected '<' for bitcast expression
fn f() { x = bitcast(y); }
^
)");
@@ -660,9 +659,8 @@
}
TEST_F(ParserImplErrorTest, GlobalDeclSampledTextureMissingLessThan) {
- EXPECT(
- "var x : texture_1d;",
- R"(test.wgsl:1:19 error: expected '< (opening template argument list)' for sampled texture type
+ EXPECT("var x : texture_1d;",
+ R"(test.wgsl:1:19 error: expected '<' for sampled texture type
var x : texture_1d;
^
)");
@@ -685,9 +683,8 @@
}
TEST_F(ParserImplErrorTest, GlobalDeclMultisampledTextureMissingLessThan) {
- EXPECT(
- "var x : texture_multisampled_2d;",
- R"(test.wgsl:1:32 error: expected '< (opening template argument list)' for multisampled texture type
+ EXPECT("var x : texture_multisampled_2d;",
+ R"(test.wgsl:1:32 error: expected '<' for multisampled texture type
var x : texture_multisampled_2d;
^
)");
@@ -833,9 +830,8 @@
}
TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingLessThan) {
- EXPECT(
- "var x : texture_storage_2d;",
- R"(test.wgsl:1:27 error: expected '< (opening template argument list)' for storage texture type
+ EXPECT("var x : texture_storage_2d;",
+ R"(test.wgsl:1:27 error: expected '<' for storage texture type
var x : texture_storage_2d;
^
)");
@@ -1200,9 +1196,8 @@
}
TEST_F(ParserImplErrorTest, GlobalDeclVarPtrMissingLessThan) {
- EXPECT(
- "var i : ptr;",
- R"(test.wgsl:1:12 error: expected '< (opening template argument list)' for ptr declaration
+ EXPECT("var i : ptr;",
+ R"(test.wgsl:1:12 error: expected '<' for ptr declaration
var i : ptr;
^
)");
@@ -1242,9 +1237,8 @@
}
TEST_F(ParserImplErrorTest, GlobalDeclVarAtomicMissingLessThan) {
- EXPECT(
- "var i : atomic;",
- R"(test.wgsl:1:15 error: expected '< (opening template argument list)' for atomic declaration
+ EXPECT("var i : atomic;",
+ R"(test.wgsl:1:15 error: expected '<' for atomic declaration
var i : atomic;
^
)");
diff --git a/src/tint/reader/wgsl/parser_impl_texture_sampler_test.cc b/src/tint/reader/wgsl/parser_impl_texture_sampler_test.cc
index 5db4e48..299bd33 100644
--- a/src/tint/reader/wgsl/parser_impl_texture_sampler_test.cc
+++ b/src/tint/reader/wgsl/parser_impl_texture_sampler_test.cc
@@ -126,8 +126,7 @@
EXPECT_EQ(t.value, nullptr);
EXPECT_FALSE(t.matched);
EXPECT_TRUE(t.errored);
- EXPECT_EQ(p->error(),
- "1:11: expected '< (opening template argument list)' for sampled texture type");
+ EXPECT_EQ(p->error(), "1:11: expected '<' for sampled texture type");
}
TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_MissingGreaterThan) {
@@ -170,8 +169,7 @@
EXPECT_EQ(t.value, nullptr);
EXPECT_FALSE(t.matched);
EXPECT_TRUE(t.errored);
- EXPECT_EQ(p->error(),
- "1:24: expected '< (opening template argument list)' for multisampled texture type");
+ EXPECT_EQ(p->error(), "1:24: expected '<' for multisampled texture type");
}
TEST_F(ParserImplTest, TextureSamplerTypes_MultisampledTexture_MissingGreaterThan) {
@@ -263,8 +261,7 @@
EXPECT_EQ(t.value, nullptr);
EXPECT_FALSE(t.matched);
EXPECT_TRUE(t.errored);
- EXPECT_EQ(p->error(),
- "1:19: expected '< (opening template argument list)' for storage texture type");
+ EXPECT_EQ(p->error(), "1:19: expected '<' for storage texture type");
}
TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_MissingGreaterThan) {
diff --git a/src/tint/reader/wgsl/parser_impl_type_decl_test.cc b/src/tint/reader/wgsl/parser_impl_type_decl_test.cc
index 9787d5e..5e18b00 100644
--- a/src/tint/reader/wgsl/parser_impl_type_decl_test.cc
+++ b/src/tint/reader/wgsl/parser_impl_type_decl_test.cc
@@ -222,7 +222,7 @@
EXPECT_FALSE(t.matched);
ASSERT_EQ(t.value, nullptr);
ASSERT_TRUE(p->has_error());
- ASSERT_EQ(p->error(), "1:5: expected '< (opening template argument list)' for ptr declaration");
+ ASSERT_EQ(p->error(), "1:5: expected '<' for ptr declaration");
}
TEST_F(ParserImplTest, TypeDecl_Ptr_MissingGreaterThanAfterType) {
@@ -262,8 +262,7 @@
EXPECT_FALSE(t.matched);
ASSERT_EQ(t.value, nullptr);
ASSERT_TRUE(p->has_error());
- ASSERT_EQ(p->error(),
- "1:19: expected '> (closing template argument list)' for ptr declaration");
+ ASSERT_EQ(p->error(), "1:19: expected '>' for ptr declaration");
}
TEST_F(ParserImplTest, TypeDecl_Ptr_MissingAddressSpace) {
@@ -371,8 +370,7 @@
EXPECT_FALSE(t.matched);
ASSERT_EQ(t.value, nullptr);
ASSERT_TRUE(p->has_error());
- ASSERT_EQ(p->error(),
- "1:8: expected '< (opening template argument list)' for atomic declaration");
+ ASSERT_EQ(p->error(), "1:8: expected '<' for atomic declaration");
}
TEST_F(ParserImplTest, TypeDecl_Atomic_MissingGreaterThan) {
@@ -573,8 +571,7 @@
EXPECT_FALSE(t.matched);
ASSERT_EQ(t.value, nullptr);
ASSERT_TRUE(p->has_error());
- ASSERT_EQ(p->error(),
- "1:11: expected '> (closing template argument list)' for array declaration");
+ ASSERT_EQ(p->error(), "1:11: expected '>' for array declaration");
}
struct MatrixData {
diff --git a/src/tint/reader/wgsl/parser_impl_type_decl_without_ident_test.cc b/src/tint/reader/wgsl/parser_impl_type_decl_without_ident_test.cc
index 2714bf8..ea146c9 100644
--- a/src/tint/reader/wgsl/parser_impl_type_decl_without_ident_test.cc
+++ b/src/tint/reader/wgsl/parser_impl_type_decl_without_ident_test.cc
@@ -213,7 +213,7 @@
EXPECT_FALSE(t.matched);
ASSERT_EQ(t.value, nullptr);
ASSERT_TRUE(p->has_error());
- ASSERT_EQ(p->error(), "1:5: expected '< (opening template argument list)' for ptr declaration");
+ ASSERT_EQ(p->error(), "1:5: expected '<' for ptr declaration");
}
TEST_F(ParserImplTest, TypeDeclWithoutIdent_Ptr_MissingGreaterThanAfterType) {
@@ -253,8 +253,7 @@
EXPECT_FALSE(t.matched);
ASSERT_EQ(t.value, nullptr);
ASSERT_TRUE(p->has_error());
- ASSERT_EQ(p->error(),
- "1:19: expected '> (closing template argument list)' for ptr declaration");
+ ASSERT_EQ(p->error(), "1:19: expected '>' for ptr declaration");
}
TEST_F(ParserImplTest, TypeDeclWithoutIdent_Ptr_MissingAddressSpace) {
@@ -362,8 +361,7 @@
EXPECT_FALSE(t.matched);
ASSERT_EQ(t.value, nullptr);
ASSERT_TRUE(p->has_error());
- ASSERT_EQ(p->error(),
- "1:8: expected '< (opening template argument list)' for atomic declaration");
+ ASSERT_EQ(p->error(), "1:8: expected '<' for atomic declaration");
}
TEST_F(ParserImplTest, TypeDeclWithoutIdent_Atomic_MissingGreaterThan) {
@@ -564,8 +562,7 @@
EXPECT_FALSE(t.matched);
ASSERT_EQ(t.value, nullptr);
ASSERT_TRUE(p->has_error());
- ASSERT_EQ(p->error(),
- "1:11: expected '> (closing template argument list)' for array declaration");
+ ASSERT_EQ(p->error(), "1:11: expected '>' for array declaration");
}
struct MatrixData {
diff --git a/src/tint/reader/wgsl/token.cc b/src/tint/reader/wgsl/token.cc
index 52706d6..f13b317 100644
--- a/src/tint/reader/wgsl/token.cc
+++ b/src/tint/reader/wgsl/token.cc
@@ -71,7 +71,6 @@
case Token::Type::kEqualEqual:
return "==";
case Token::Type::kTemplateArgsRight:
- return "> (closing template argument list)";
case Token::Type::kGreaterThan:
return ">";
case Token::Type::kGreaterThanEqual:
@@ -79,7 +78,6 @@
case Token::Type::kShiftRight:
return ">>";
case Token::Type::kTemplateArgsLeft:
- return "< (opening template argument list)";
case Token::Type::kLessThan:
return "<";
case Token::Type::kLessThanEqual: