| 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 | } |