@@ -160,6 +160,7 @@ namespace xcpp
160160 tagfile = it->at (" tagfile" );
161161 std::string filename = tagfiles_dir + " /" + tagfile;
162162 pugi::xml_document doc;
163+ doc.load_file (filename.c_str ());
163164 class_member_predicate predicate{typename_, " function" , method[2 ]};
164165 auto node = doc.find_node (predicate);
165166 if (!node.empty ())
@@ -193,6 +194,7 @@ namespace xcpp
193194 tagfile = it->at (" tagfile" );
194195 std::string filename = tagfiles_dir + " /" + tagfile;
195196 pugi::xml_document doc;
197+ doc.load_file (filename.c_str ());
196198 for (auto c : check)
197199 {
198200 node_predicate predicate{c, find_string};
@@ -262,5 +264,36 @@ namespace xcpp
262264 kernel_res[" status" ] = " ok" ;
263265 }
264266 }
267+
268+ class xintrospection : public xpreamble
269+ {
270+ public:
271+
272+ using xpreamble::pattern;
273+ const std::string spattern = R"( ^\?)" ;
274+
275+ xintrospection (clang::Interpreter& p)
276+ : m_interpreter{p}
277+ {
278+ pattern = spattern;
279+ }
280+
281+ void apply (const std::string& code, nl::json& kernel_res) override
282+ {
283+ std::regex re (spattern + R"( (.*))" );
284+ std::smatch to_inspect;
285+ std::regex_search (code, to_inspect, re);
286+ inspect (to_inspect[1 ], kernel_res, m_interpreter);
287+ }
288+
289+ virtual xpreamble* clone () const override
290+ {
291+ return new xintrospection (*this );
292+ }
293+
294+ private:
295+
296+ clang::Interpreter& m_interpreter;
297+ };
265298}
266299#endif
0 commit comments