Rename brace and bracket to match spec
The names for brace and bracket got flipped in the spec, update Tint to
match.
Change-Id: Ifbad5f239834b77b9aa27ef21b9d704cab742f4f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/21260
Reviewed-by: David Neto <dneto@google.com>
diff --git a/src/reader/wgsl/parser_impl.cc b/src/reader/wgsl/parser_impl.cc
index be74cec..cf28229 100644
--- a/src/reader/wgsl/parser_impl.cc
+++ b/src/reader/wgsl/parser_impl.cc
@@ -987,7 +987,7 @@
}
t = peek();
- if (!t.IsBracketLeft()) {
+ if (!t.IsBraceLeft()) {
set_error(t, "missing { for struct declaration");
return nullptr;
}
@@ -1042,13 +1042,13 @@
// : BRACKET_LEFT struct_member* BRACKET_RIGHT
ast::StructMemberList ParserImpl::struct_body_decl() {
auto t = peek();
- if (!t.IsBracketLeft())
+ if (!t.IsBraceLeft())
return {};
next(); // Consume the peek
t = peek();
- if (t.IsBracketRight())
+ if (t.IsBraceRight())
return {};
ast::StructMemberList members;
@@ -1064,12 +1064,12 @@
members.push_back(std::move(mem));
t = peek();
- if (t.IsBracketRight() || t.IsEof())
+ if (t.IsBraceRight() || t.IsEof())
break;
}
t = next();
- if (!t.IsBracketRight()) {
+ if (!t.IsBraceRight()) {
set_error(t, "missing } for struct declaration");
return {};
}
@@ -1376,7 +1376,7 @@
// : BRACKET_LEFT statements BRACKET_RIGHT
ast::StatementList ParserImpl::body_stmt() {
auto t = peek();
- if (!t.IsBracketLeft())
+ if (!t.IsBraceLeft())
return {};
next(); // Consume the peek
@@ -1386,7 +1386,7 @@
return {};
t = next();
- if (!t.IsBracketRight()) {
+ if (!t.IsBraceRight()) {
set_error(t, "missing }");
return {};
}
@@ -1733,7 +1733,7 @@
}
t = peek();
- if (!t.IsBracketLeft()) {
+ if (!t.IsBraceLeft()) {
set_error(t, "missing {");
return nullptr;
}
@@ -1781,7 +1781,7 @@
}
t = peek();
- if (!t.IsBracketLeft()) {
+ if (!t.IsBraceLeft()) {
set_error(t, "missing {");
return {};
}
@@ -1812,7 +1812,7 @@
next(); // Consume the peek
t = peek();
- if (!t.IsBracketLeft()) {
+ if (!t.IsBraceLeft()) {
set_error(t, "missing {");
return nullptr;
}
@@ -1869,7 +1869,7 @@
}
t = next();
- if (!t.IsBracketLeft()) {
+ if (!t.IsBraceLeft()) {
set_error(t, "missing { for switch statement");
return nullptr;
}
@@ -1886,7 +1886,7 @@
}
t = next();
- if (!t.IsBracketRight()) {
+ if (!t.IsBraceRight()) {
set_error(t, "missing } for switch statement");
return nullptr;
}
@@ -1925,7 +1925,7 @@
}
t = next();
- if (!t.IsBracketLeft()) {
+ if (!t.IsBraceLeft()) {
set_error(t, "missing { for case statement");
return nullptr;
}
@@ -1937,7 +1937,7 @@
stmt->set_body(std::move(body));
t = next();
- if (!t.IsBracketRight()) {
+ if (!t.IsBraceRight()) {
set_error(t, "missing } for case statement");
return nullptr;
}
@@ -1990,7 +1990,7 @@
next(); // Consume the peek
t = next();
- if (!t.IsBracketLeft()) {
+ if (!t.IsBraceLeft()) {
set_error(t, "missing { for loop");
return nullptr;
}
@@ -2004,7 +2004,7 @@
return nullptr;
t = next();
- if (!t.IsBracketRight()) {
+ if (!t.IsBraceRight()) {
set_error(t, "missing } for loop");
return nullptr;
}
@@ -2298,7 +2298,7 @@
auto t = peek();
auto source = t.source();
- if (t.IsBraceLeft()) {
+ if (t.IsBracketLeft()) {
next(); // Consume the peek
auto param = logical_or_expression();
@@ -2310,7 +2310,7 @@
}
t = next();
- if (!t.IsBraceRight()) {
+ if (!t.IsBracketRight()) {
set_error(t, "missing ] for array accessor");
return nullptr;
}