================
@@ -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
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to