diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 03:42:49 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 04:05:50 +0000 |
| commit | d603a3bab5ee07e3fe8665a7dce8c80cb391ca08 (patch) | |
| tree | 43d55d6f029959aafdf4700cb6c21c47a441b5da /lib/Parser/Parser.cc | |
| parent | 0b87ded993d59450ab70ade6e4ce154da65948a3 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'lib/Parser/Parser.cc')
| -rw-r--r-- | lib/Parser/Parser.cc | 9 |
1 files changed, 1 insertions, 8 deletions
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<StmtAST> Parser::ParseStatementImpl() { std::unique_ptr<StmtAST> 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<std::string> TemplateArgs; if (CurTok == '<') { |
