[Lldb-commits] [lldb] [LLDB] Add `ScalarLiteralNode` and literal parsing in DIL (PR #152308)
Ilia Kuklin via lldb-commits
lldb-commits at lists.llvm.org
Sun Aug 17 07:32:51 PDT 2025
================
@@ -175,7 +185,27 @@ TEST(DILLexerTests, NumbersTest) {
EXPECT_THAT_EXPECTED(maybe_lexer, llvm::Succeeded());
DILLexer lexer(*maybe_lexer);
Token token = lexer.GetCurrentToken();
- EXPECT_TRUE(token.IsNot(Token::numeric_constant));
+ EXPECT_TRUE(token.IsNot(Token::integer_constant));
EXPECT_TRUE(token.IsOneOf({Token::eof, Token::identifier}));
}
+
+ // Verify that '-' and '+' are not lexed if they're not part of a number
+ std::vector<std::string> expressions = {"1+e", "0x1+p", "1.1+e",
----------------
kuilpd wrote:
I added this case, and then found out that actual C++ gives an error on numbers like `0xe+1`, saying that's a wrong suffix. Our lexer will now treat it as 2 separate numbers, which seems to be more reasonable, or is there some case again with this format that I'm missing?
https://github.com/llvm/llvm-project/pull/152308
More information about the lldb-commits
mailing list