diff --git a/src/reader/wgsl/lexer.cc b/src/reader/wgsl/lexer.cc index 632aa1fea0..5fd1ef49a2 100644 --- a/src/reader/wgsl/lexer.cc +++ b/src/reader/wgsl/lexer.cc @@ -216,6 +216,7 @@ Token Lexer::build_token_from_int_if_possible(const Source& source, return {Token::Type::kError, source, "u32 (" + input_.substr(start, end - start) + ") too large"}; } + pos_ += 1; return {source, static_cast(res)}; } diff --git a/src/reader/wgsl/lexer_test.cc b/src/reader/wgsl/lexer_test.cc index 9953443657..de64e6f6bd 100644 --- a/src/reader/wgsl/lexer_test.cc +++ b/src/reader/wgsl/lexer_test.cc @@ -249,6 +249,9 @@ TEST_P(IntegerTest_HexUnsigned, Matches) { EXPECT_EQ(t.line(), 1u); EXPECT_EQ(t.column(), 1u); EXPECT_EQ(t.to_u32(), params.result); + + t = l.next(); + EXPECT_TRUE(t.IsEof()); } INSTANTIATE_TEST_SUITE_P( LexerTest,