diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-17 06:52:23 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-17 06:52:23 +0000 |
| commit | 39661855c0816ac248be437704c76f58359cb5f0 (patch) | |
| tree | 202b014805e40208e3adb861f4a97d31770f13e6 /lib/Parser | |
| parent | c89477d615fb0ce4d89786ef848ffe6aca1da088 (diff) | |
feat(classes): construct declared objects and nested fields and arrays
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/Parser')
| -rw-r--r-- | lib/Parser/ParserType.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Parser/ParserType.cc b/lib/Parser/ParserType.cc index dab71a1..dfeacf1 100644 --- a/lib/Parser/ParserType.cc +++ b/lib/Parser/ParserType.cc @@ -308,7 +308,15 @@ std::unique_ptr<StmtAST> Parser::ParseDeclare() { if (TypeStr.empty()) { return nullptr; } - return std::make_unique<DeclareStmtAST>(Name, TypeStr); + bool HasParens = CurTok == '('; + std::vector<std::unique_ptr<ExprAST>> Args; + if (HasParens) { + getNextToken(); + auto Parsed = ParseExprList(')', true); + if (!Parsed) return nullptr; + Args = std::move(*Parsed); + } + return std::make_unique<DeclareStmtAST>(Name, TypeStr, std::move(Args), HasParens); } } |
