summaryrefslogtreecommitdiff
path: root/test/gtest
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-04-25 20:48:08 -0700
committerGitHub <noreply@github.com>2024-04-25 20:48:08 -0700
commit35560732b6a2c6960a6e72ea478bc0238a967c30 (patch)
tree14f91fbd240f7b7d7e6b942af63b2ee3bcff2034 /test/gtest
parentc33f126046d6504064d587b8bd7c310a7fdf2087 (diff)
downloadbinaryen-35560732b6a2c6960a6e72ea478bc0238a967c30.tar.gz
binaryen-35560732b6a2c6960a6e72ea478bc0238a967c30.tar.bz2
binaryen-35560732b6a2c6960a6e72ea478bc0238a967c30.zip
[Parser] Do not eagerly lex parens (#6540)
The lexer currently lexes tokens eagerly and stores them in a `Token` variant ahead of when they are actually requested by the parser. It is wasteful, however, to classify tokens before they are requested by the parser because it is likely that the next token will be precisely the kind the parser requests. The work of checking and rejecting other possible classifications ahead of time is not useful. To make incremental progress toward removing `Token` completely, lex parentheses on demand instead of eagerly.
Diffstat (limited to 'test/gtest')
-rw-r--r--test/gtest/wat-lexer.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/test/gtest/wat-lexer.cpp b/test/gtest/wat-lexer.cpp
index 8e31b9ab9..baead9ab9 100644
--- a/test/gtest/wat-lexer.cpp
+++ b/test/gtest/wat-lexer.cpp
@@ -77,9 +77,6 @@ TEST(LexerTest, LexBlockComment) {
}
TEST(LexerTest, LexParens) {
- Token left{"("sv, LParenTok{}};
- Token right{")"sv, RParenTok{}};
-
Lexer lexer("(())"sv);
ASSERT_FALSE(lexer.empty());