![]()  | 
  
    ArkScript
    
   A small, lisp-inspired, functional scripting language 
   | 
 
Handles Conditional macros. More...
#include <Conditional.hpp>
Public Member Functions | |
| bool | applyMacro (Node &node, unsigned depth) override | 
| bool | canHandle (Node &node) override | 
| Node | macroNode (Node &node) override | 
| Returns the macro node that will be expanded.   | |
| MacroExecutor (MacroProcessor *processor, unsigned debug=0) | |
| Construct a new Macro Executor object.   | |
  Public Member Functions inherited from Ark::internal::MacroExecutor | |
| 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 | |
  Protected Member Functions inherited from Ark::internal::MacroExecutor | |
| 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.   | |
| void | throwMacroProcessingError (const std::string &message, const Node &node) | 
| Throw a macro processing error.   | |
  Protected Attributes inherited from Ark::internal::MacroExecutor | |
| unsigned int | m_debug | 
| MacroProcessor * | m_processor | 
| This is a non-owned pointer.   | |
Handles Conditional macros.
Definition at line 23 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 36 of file Executor.cpp.
Returns the macro node that will be expanded.
| node | AST node on which the executor will run | 
Implements Ark::internal::MacroExecutor.
Definition at line 38 of file Conditional.cpp.