diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-17 06:02:21 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-17 06:02:21 +0000 |
| commit | 3425b95cb654f8e1adc98365a4b370aa1fff8b4d (patch) | |
| tree | 4d81b91d0bd807cd6f7ced037533d6e60f5c307f /lib/Parser/Parser.cc | |
| parent | 4e22f464387725a5a282f3d72e11cfb694a31a5a (diff) | |
feat(classes): support ordinary member methods and this references
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'lib/Parser/Parser.cc')
| -rw-r--r-- | lib/Parser/Parser.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Parser/Parser.cc b/lib/Parser/Parser.cc index 36b0a6a..26eeac6 100644 --- a/lib/Parser/Parser.cc +++ b/lib/Parser/Parser.cc @@ -231,6 +231,12 @@ std::unique_ptr<StmtAST> Parser::ParseAssignStmt() { std::vector<DesignatorAccess> Accesses; if (!ParseDesignatorSuffix(Accesses)) return nullptr; + if (CurTok == '(') { + auto Call = ParseMemberCall(Name, std::move(Accesses), Line); + if (!Call) return nullptr; + return std::make_unique<MemberCallStmtAST>(std::move(Call)); + } + if (CurTok != tok_assign) { fprintf(stderr, "error: Expected '<-' after identifier '%s' at line %d\n", Name.c_str(), Line); return nullptr; |
