![]() |
ArkScript
A small, fast, functional and scripting language for video games
|
Handles Conditional macros. More...
#include <Conditional.hpp>
Public Member Functions | |
bool | applyMacro (Node &node, unsigned depth) override |
bool | canHandle (Node &node) override |
MacroExecutor (MacroProcessor *processor, unsigned debug=0) | |
Construct a new Macro Executor object. | |
![]() | |
MacroExecutor (MacroProcessor *processor, unsigned debug=0) | |
Construct a new Macro Executor object. | |
virtual | ~MacroExecutor ()=default |
Need a virtual destructor to correctly destroy object. | |
Additional Inherited Members | |
![]() | |
const Node * | findNearestMacro (const std::string &name) const |
Find the nearest macro matching a giving name. | |
void | applyMacroProxy (Node &node, unsigned depth) |
Apply a macro on a given node. | |
void | handleMacroNode (Node &node) const |
Registers macros based on their type, expand conditional macros. | |
bool | isTruthy (const Node &node) const |
Check if a node can be evaluated to true. | |
Node | evaluate (Node &node, unsigned depth, bool is_not_body) const |
Evaluate only the macros. | |
![]() | |
static void | throwMacroProcessingError (const std::string &message, const Node &node) |
Throw a macro processing error. | |
![]() | |
unsigned int | m_debug |
MacroProcessor * | m_processor |
This is a non-owned pointer. | |
Handles Conditional macros.
Definition at line 24 of file Conditional.hpp.
|
overridevirtual |
node | |
depth | depth of the macro processor evalution |
Implements Ark::internal::MacroExecutor.
Definition at line 5 of file Conditional.cpp.
References Ark::internal::MacroExecutor::applyMacroProxy(), Ark::internal::Node::constList(), Ark::internal::MacroExecutor::evaluate(), Ark::internal::getNilNode(), Ark::internal::MacroExecutor::handleMacroNode(), Ark::internal::MacroExecutor::isTruthy(), Ark::internal::Node::list(), Ark::internal::Macro, Ark::internal::Node::nodeType(), Ark::internal::Node::setNodeType(), Ark::internal::Unused, and Ark::internal::Node::updateValueAndType().
|
nodiscardoverridevirtual |
node |
Implements Ark::internal::MacroExecutor.
Definition at line 33 of file Conditional.cpp.
References Ark::internal::If, Ark::internal::Keyword, Ark::internal::Node::list(), Ark::internal::Macro, and Ark::internal::Node::nodeType().
|
explicit |
Construct a new Macro Executor object.
processor | |
debug |
Definition at line 37 of file Executor.cpp.
References Ark::internal::MacroProcessor::throwMacroProcessingError().