aboutsummaryrefslogtreecommitdiff
path: root/include/cps/Parser.h
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-17 06:02:21 +0000
committer_ov4 <ov4@ov4.org>2026-10-17 06:02:21 +0000
commit3425b95cb654f8e1adc98365a4b370aa1fff8b4d (patch)
tree4d81b91d0bd807cd6f7ced037533d6e60f5c307f /include/cps/Parser.h
parent4e22f464387725a5a282f3d72e11cfb694a31a5a (diff)
feat(classes): support ordinary member methods and this references
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'include/cps/Parser.h')
-rw-r--r--include/cps/Parser.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/cps/Parser.h b/include/cps/Parser.h
index fdbb99a..4874d7a 100644
--- a/include/cps/Parser.h
+++ b/include/cps/Parser.h
@@ -43,6 +43,8 @@ class Parser {
std::unique_ptr<ExprAST> ParseNumberExpr();
std::unique_ptr<ExprAST> ParseIdentifierExpr();
std::unique_ptr<ExprAST> ParseParenExpr();
+ std::unique_ptr<MemberCallExprAST> ParseMemberCall(
+ const std::string &Name, std::vector<DesignatorAccess> Accesses, int Line);
std::string ParseTypeName(bool AllowVoid = false);
std::unique_ptr<StmtAST> ParseStatement();
@@ -66,11 +68,12 @@ class Parser {
std::unique_ptr<StmtAST> ParseTypeDecl();
std::optional<std::vector<RecordFieldDecl>> ParseRecordBody(
- const std::string &Name, int Line, int EndToken);
+ const std::string &Name, int Line, int EndToken,
+ std::vector<std::unique_ptr<FunctionDefAST>> *Methods = nullptr);
bool ParseRecordField(std::vector<RecordFieldDecl> &Out, bool IsPublic);
- std::unique_ptr<StmtAST> ParseFunction();
- std::unique_ptr<StmtAST> ParseProcedure();
+ std::unique_ptr<FunctionDefAST> ParseFunction(const std::string &OwnerClass = {}, bool IsPublic = true);
+ std::unique_ptr<FunctionDefAST> ParseProcedure(const std::string &OwnerClass = {}, bool IsPublic = true);
std::unique_ptr<StmtAST> ParseCallStmt();
std::unique_ptr<StmtAST> ParseReturnStmt();
std::optional<std::vector<ParamDecl>> ParsePrototypeArgs(bool AllowByRef);