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 --- include/cps/Parser.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/cps/Parser.h') diff --git a/include/cps/Parser.h b/include/cps/Parser.h index 39adfd1..9bf8afb 100644 --- a/include/cps/Parser.h +++ b/include/cps/Parser.h @@ -46,7 +46,8 @@ class Parser { std::unique_ptr ParseNumberExpr(); std::unique_ptr ParseIdentifierExpr(); - std::string ParseOperatorName(int &Op); + std::string ParseOperatorName(int *Op = nullptr); + bool ParseCalleeName(std::string &Name); std::unique_ptr ParseParenExpr(); std::unique_ptr ParseMemberCall( const std::string &Name, std::vector Accesses, int Line); -- cgit v1.3.1-4-g156e