// include/Ast/FunctionCall.hpp #pragma once #include #include namespace Fig::Ast { struct FunctionArguments { std::vector argv; size_t getLength() const { return argv.size(); } }; struct FunctionCallArgs final { std::vector argv; size_t getLength() const { return argv.size(); } }; class FunctionCallExpr final : public ExpressionAst { public: Expression callee; // 不是 name 了!! FunctionArguments arg; FunctionCallExpr() { type = AstType::FunctionCall; } FunctionCallExpr(Expression _callee, FunctionArguments _arg) : callee(std::move(_callee)), arg(std::move(_arg)) { type = AstType::FunctionCall; } virtual FString toString() override { FString s = callee->toString(); s += u8"("; for (size_t i = 0; i < arg.argv.size(); ++i) { s += arg.argv[i]->toString(); if (i + 1 < arg.argv.size()) s += u8", "; } s += u8")"; return s; } }; using FunctionCall = std::shared_ptr; }; // namespace Fig