This repository has been archived on 2024-03-07. You can view files and clone it, but cannot push or open issues/pull-requests.
zarn/src/NativeFunction.cpp

25 lines
519 B
C++

#include "NativeFunction.hpp"
namespace zn
{
/*explicit*/ NativeFunction::NativeFunction(std::shared_ptr<Prototype>
prototype,
native_fn_t body)
: m_prototype { prototype }
, m_body { body }
{
}
/*virtual*/ NativeFunction::~NativeFunction()
{
}
std::shared_ptr<Constant>
NativeFunction::call(std::vector<std::shared_ptr<Constant>> const& args)
{
assert(m_body);
return m_body(args);
}
}