================
@@ -178,11 +178,40 @@ ASTNodeUP DILParser::ParsePrimaryExpression() {
   }
 
   if (CurToken().Is(Token::l_paren)) {
-    m_dil_lexer.Advance();
-    auto expr = ParseExpression();
-    Expect(Token::r_paren);
-    m_dil_lexer.Advance();
-    return expr;
+    // Check in case this is an anonynmous namespace
+    if (m_dil_lexer.LookAhead(1).Is(Token::identifier) &&
+        (m_dil_lexer.LookAhead(1).GetSpelling() == "anonymous") &&
+        m_dil_lexer.LookAhead(2).Is(Token::identifier) &&
+        (m_dil_lexer.LookAhead(2).GetSpelling() == "namespace") &&
+        m_dil_lexer.LookAhead(3).Is(Token::r_paren) &&
+        m_dil_lexer.LookAhead(4).Is(Token::coloncolon)) {
+      m_dil_lexer.Advance(4);
+
+      std::string identifier = "(anonymous namespace)";
----------------
labath wrote:

Instead of basically inlining a part of ParseIdExpression, could we find a way 
to delegate to it? What would happen if we changed the check on line 172 to say 
"if next token is :: or identifier *OR* next 4 tokens are '(anonymous 
namespace)'" ?

https://github.com/llvm/llvm-project/pull/145055
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to