// This file is distributed under the BSD License. // See "license.txt" for details. // Copyright 2009-2012, Jonathan Turner (jonathan@emptycrate.com) // Copyright 2009-2017, Jason Turner (jason@emptycrate.com) // http://www.chaiscript.com #ifndef CHAISCRIPT_TRACER_HPP_ #define CHAISCRIPT_TRACER_HPP_ namespace chaiscript { namespace eval { struct Noop_Tracer_Detail { template void trace(const chaiscript::detail::Dispatch_State &, const AST_Node_Impl *) { } }; template struct Tracer : T... { Tracer() = default; explicit Tracer(T ... t) : T(std::move(t))... { } void do_trace(const chaiscript::detail::Dispatch_State &ds, const AST_Node_Impl> *node) { (void)std::initializer_list{ (static_cast(*this).trace(ds, node), 0)... }; } static void trace(const chaiscript::detail::Dispatch_State &ds, const AST_Node_Impl> *node) { ds->get_parser().get_tracer>().do_trace(ds, node); } }; typedef Tracer Noop_Tracer; } } #endif