aboutsummaryrefslogtreecommitdiff
path: root/include/cps/Parser.h
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 03:42:49 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 04:05:50 +0000
commitd603a3bab5ee07e3fe8665a7dce8c80cb391ca08 (patch)
tree43d55d6f029959aafdf4700cb6c21c47a441b5da /include/cps/Parser.h
parent0b87ded993d59450ab70ade6e4ce154da65948a3 (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 'include/cps/Parser.h')
-rw-r--r--include/cps/Parser.h3
1 files changed, 2 insertions, 1 deletions
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<ExprAST> ParseNumberExpr();
std::unique_ptr<ExprAST> ParseIdentifierExpr();
- std::string ParseOperatorName(int &Op);
+ std::string ParseOperatorName(int *Op = nullptr);
+ bool ParseCalleeName(std::string &Name);
std::unique_ptr<ExprAST> ParseParenExpr();
std::unique_ptr<MemberCallExprAST> ParseMemberCall(
const std::string &Name, std::vector<DesignatorAccess> Accesses, int Line);