aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/scripts/ConditionScript.cpp
blob: c556bd2fe82a29e3c1b9c984ecded6f652a273e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "ConditionScript.hpp"

#include "openvic-simulation/DefinitionManager.hpp"

using namespace OpenVic;
using namespace OpenVic::NodeTools;

ConditionScript::ConditionScript(
   scope_type_t new_initial_scope, scope_type_t new_this_scope, scope_type_t new_from_scope
) : initial_scope { new_initial_scope }, this_scope { new_this_scope }, from_scope { new_from_scope } {}

bool ConditionScript::_parse_script(ast::NodeCPtr root, DefinitionManager const& definition_manager) {
   return definition_manager.get_script_manager().get_condition_manager().expect_condition_script(
      definition_manager,
      initial_scope,
      this_scope,
      from_scope,
      move_variable_callback(condition_root)
   )(root);
}