@@ -160,6 +160,7 @@ namespace xcpp
160
160
tagfile = it->at (" tagfile" );
161
161
std::string filename = tagfiles_dir + " /" + tagfile;
162
162
pugi::xml_document doc;
163
+ doc.load_file (filename.c_str ());
163
164
class_member_predicate predicate{typename_, " function" , method[2 ]};
164
165
auto node = doc.find_node (predicate);
165
166
if (!node.empty ())
@@ -193,6 +194,7 @@ namespace xcpp
193
194
tagfile = it->at (" tagfile" );
194
195
std::string filename = tagfiles_dir + " /" + tagfile;
195
196
pugi::xml_document doc;
197
+ doc.load_file (filename.c_str ());
196
198
for (auto c : check)
197
199
{
198
200
node_predicate predicate{c, find_string};
@@ -262,5 +264,36 @@ namespace xcpp
262
264
kernel_res[" status" ] = " ok" ;
263
265
}
264
266
}
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
+ };
265
298
}
266
299
#endif
0 commit comments