wsgl parser: Tweak top-level unexpected token error message

I feel this reads better.

Bug: tint:282
Change-Id: I04fe42a0347ea050e93e5cf5ccae7259bc79bb58
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32283
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton 2020-11-11 14:16:45 +00:00 committed by Commit Bot service account
parent b707258c8f
commit 1bbafa3445
2 changed files with 2 additions and 2 deletions

View File

@ -286,7 +286,7 @@ Expect<bool> ParserImpl::expect_global_decl() {
if (decos.value.size() > 0) { if (decos.value.size() > 0) {
add_error(peek(), "expected declaration after decorations"); add_error(peek(), "expected declaration after decorations");
} else { } else {
add_error(peek(), "invalid token"); add_error(peek(), "unexpected token");
} }
return Failure::kErrored; return Failure::kErrored;
} }

View File

@ -1262,7 +1262,7 @@ TEST_F(ParserImplErrorTest, UnaryInvalidExpr) {
TEST_F(ParserImplErrorTest, UnexpectedToken) { TEST_F(ParserImplErrorTest, UnexpectedToken) {
EXPECT("unexpected", EXPECT("unexpected",
"test.wgsl:1:1 error: invalid token\n" "test.wgsl:1:1 error: unexpected token\n"
"unexpected\n" "unexpected\n"
"^^^^^^^^^^\n"); "^^^^^^^^^^\n");
} }