Initial take on Tracer hooks

This will allow the user to add hooks in for debugging / execution
tracing / throttling / etc for each node execution

The cost is *almost* 0 if no tracing is enabled.
This commit is contained in:
Jason Turner
2016-04-30 20:53:01 -06:00
parent dcedd64032
commit 03803ee4c4
8 changed files with 523 additions and 355 deletions

View File

@@ -580,7 +580,8 @@ namespace chaiscript
{fun(&AST_Node::to_string), "to_string"},
{fun([](const chaiscript::AST_Node &t_node) -> std::vector<Boxed_Value> {
std::vector<Boxed_Value> retval;
std::transform(t_node.children.begin(), t_node.children.end(),
const auto children = t_node.get_children();
std::transform(children.begin(), children.end(),
std::back_inserter(retval),
&chaiscript::var<const std::shared_ptr<chaiscript::AST_Node> &>);
return retval;