Initial support for require statements
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
32
src/Binder/BoundExpressions/BoundRequireExpression.hpp
Normal file
32
src/Binder/BoundExpressions/BoundRequireExpression.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef PORYGONLANG_BOUNDREQUIREEXPRESSION_HPP
|
||||
#define PORYGONLANG_BOUNDREQUIREEXPRESSION_HPP
|
||||
|
||||
#include "BoundExpression.hpp"
|
||||
#include "../../Script.hpp"
|
||||
|
||||
namespace Porygon::Binder {
|
||||
class BoundRequireExpression : public BoundExpression {
|
||||
Script* _module;
|
||||
public:
|
||||
BoundRequireExpression(Script* script, unsigned int start,
|
||||
unsigned int length)
|
||||
: BoundExpression(start, length, script->GetReturnType()),
|
||||
_module(script){}
|
||||
|
||||
~BoundRequireExpression() final{
|
||||
delete _module;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
inline Script* GetModule() const{
|
||||
return _module;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
inline BoundExpressionKind GetKind() const final {
|
||||
return BoundExpressionKind::Require;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //PORYGONLANG_BOUNDREQUIREEXPRESSION_HPP
|
||||
Reference in New Issue
Block a user