#pragma once #include "AST/Base.h" #include #include namespace ast { typedef std::pair FnArg; class FnDecl : public Stmt { public: FnDecl(const std::string &name, const std::vector &args, const Type *returnType, const Expr *body) : name(name), args(std::move(args)), returnType(returnType), body(body) {} ~FnDecl() { for (auto &arg : args) delete arg.second; delete returnType; delete body; } const std::string name; const std::vector args; const Type *returnType; const Expr *body; }; }