MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / library

Method library

include/chaiscript/chaiscript_stdlib.hpp:45–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 public:
44
45 static ModulePtr library()
46 {
47 auto lib = std::make_shared<Module>();
48 bootstrap::Bootstrap::bootstrap(*lib);
49
50 bootstrap::standard_library::vector_type<std::vector<Boxed_Value> >("Vector", *lib);
51 bootstrap::standard_library::string_type<std::string>("string", *lib);
52 bootstrap::standard_library::map_type<std::map<std::string, Boxed_Value> >("Map", *lib);
53 bootstrap::standard_library::pair_type<std::pair<Boxed_Value, Boxed_Value > >("Pair", *lib);
54
55#ifndef CHAISCRIPT_NO_THREADS
56 bootstrap::standard_library::future_type<std::future<chaiscript::Boxed_Value>>("future", *lib);
57 lib->add(chaiscript::fun([](const std::function<chaiscript::Boxed_Value ()> &t_func){ return std::async(std::launch::async, t_func);}), "async");
58#endif
59
60 json_wrap::library(*lib);
61
62 lib->eval(ChaiScript_Prelude::chaiscript_prelude() /*, "standard prelude"*/ );
63
64 return lib;
65 }
66
67 };
68}

Callers

nothing calls this directly

Calls 3

funFunction · 0.85
addMethod · 0.45
evalMethod · 0.45

Tested by

no test coverage detected