polserver/pol-core/bscript/compiler/ast/Function.h
Kevin Eady 6a7968c20b Address final implementation TODOs (#706)
* Address code TODOs

* Update Escript version!
2024-10-10 18:06:04 +02:00

37 lines
1.1 KiB
C++

#ifndef POLSERVER_FUNCTION_H
#define POLSERVER_FUNCTION_H
#include "bscript/compiler/ast/Node.h"
namespace Pol::Bscript::Compiler
{
class FunctionParameterDeclaration;
class FunctionParameterList;
class FunctionBody;
class Function : public Node
{
public:
Function( const SourceLocation&, std::string scope, std::string name,
std::unique_ptr<FunctionParameterList>, std::unique_ptr<FunctionBody> );
Function( const SourceLocation&, std::string scope, std::string name,
std::unique_ptr<FunctionParameterList> );
unsigned parameter_count() const;
bool is_variadic() const;
// Function does not use ScopableName. ScopableName is only needed when we
// must differentiate between an _empty_ scope and a _global_ scope. This is
// not the case for Functions, as there is no difference between empty and
// global.
std::string scoped_name() const;
std::vector<std::reference_wrapper<FunctionParameterDeclaration>> parameters();
const std::string scope;
const std::string name;
};
} // namespace Pol::Bscript::Compiler
#endif // POLSERVER_FUNCTION_H