From d603a3bab5ee07e3fe8665a7dce8c80cb391ca08 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 03:42:49 +0000 Subject: refactor(parser): share callee-name parsing and make operator out-param optional ParseOperatorName() takes an optional int * so callers that ignore the operator token no longer declare a dummy. The identical identifier-or- OPERATOR prologues of assignment, identifier-expression and CALL parsing move into ParseCalleeName(). Co-Authored-By: Claude Opus 5.5 --- lib/Parser/Parser.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'lib/Parser/Parser.cc') diff --git a/lib/Parser/Parser.cc b/lib/Parser/Parser.cc index 8b1c519..b81bf55 100644 --- a/lib/Parser/Parser.cc +++ b/lib/Parser/Parser.cc @@ -285,14 +285,7 @@ std::unique_ptr Parser::ParseStatementImpl() { std::unique_ptr Parser::ParseAssignStmt() { int Line = Lex.getLine(); std::string Name; - if (CurTok == tok_operator) { - int Op; - Name = ParseOperatorName(Op); - if (Name.empty()) return nullptr; - } else { - Name = Lex.IdentifierStr; - getNextToken(); - } + if (!ParseCalleeName(Name)) return nullptr; std::vector TemplateArgs; if (CurTok == '<') { -- cgit v1.3.1-4-g156e