16
16
#include < string>
17
17
#include < vector>
18
18
19
- #include < xtl /xsystem.hpp>
19
+ #include " xeus /xsystem.hpp"
20
20
21
21
#include < xeus/xhelper.hpp>
22
22
@@ -127,27 +127,27 @@ __get_cxx_version ()
127
127
restore_output ();
128
128
}
129
129
130
- nl::json interpreter::execute_request_impl (
131
- int /* execution_counter*/ ,
130
+ void interpreter::execute_request_impl (
131
+ send_reply_callback cb,
132
+ int /* execution_count*/ ,
132
133
const std::string& code,
133
- bool silent,
134
- bool /* store_history*/ ,
135
- nl::json /* user_expressions*/ ,
136
- bool allow_stdin
134
+ xeus::execute_request_config config,
135
+ nl::json /* user_expressions*/
137
136
)
138
137
{
139
138
nl::json kernel_res;
140
139
141
140
142
- auto input_guard = input_redirection (allow_stdin);
141
+ auto input_guard = input_redirection (config. allow_stdin );
143
142
144
143
// Check for magics
145
144
for (auto & pre : preamble_manager.preamble )
146
145
{
147
146
if (pre .second .is_match (code))
148
147
{
149
148
pre .second .apply (code, kernel_res);
150
- return kernel_res;
149
+ cb (kernel_res);
150
+ return ;
151
151
}
152
152
}
153
153
@@ -162,7 +162,7 @@ __get_cxx_version ()
162
162
auto cout_strbuf = std::cout.rdbuf ();
163
163
auto cerr_strbuf = std::cerr.rdbuf ();
164
164
165
- if (silent)
165
+ if (config. silent )
166
166
{
167
167
auto null = xnull ();
168
168
std::cout.rdbuf (&null);
@@ -202,7 +202,7 @@ __get_cxx_version ()
202
202
std::cerr << std::flush;
203
203
204
204
// Reset non-silent output buffers
205
- if (silent)
205
+ if (config. silent )
206
206
{
207
207
std::cout.rdbuf (cout_strbuf);
208
208
std::cerr.rdbuf (cerr_strbuf);
@@ -221,7 +221,7 @@ __get_cxx_version ()
221
221
ename = " " ;
222
222
}
223
223
std::vector<std::string> traceback ({ename + evalue});
224
- if (!silent)
224
+ if (!config. silent )
225
225
{
226
226
publish_execution_error (ename, evalue, traceback);
227
227
}
@@ -237,7 +237,7 @@ __get_cxx_version ()
237
237
/*
238
238
// Publish a mime bundle for the last return value if
239
239
// the semicolon was omitted.
240
- if (!silent && output.hasValue() && trim(code).back() != ';')
240
+ if (!config. silent && output.hasValue() && trim(code).back() != ';')
241
241
{
242
242
nl::json pub_data = mime_repr(output);
243
243
publish_execution_result(execution_counter, std::move(pub_data), nl::json::object());
@@ -248,7 +248,8 @@ __get_cxx_version ()
248
248
kernel_res[" payload" ] = nl::json::array ();
249
249
kernel_res[" user_expressions" ] = nl::json::object ();
250
250
}
251
- return kernel_res;
251
+ cb (kernel_res);
252
+ return ;
252
253
}
253
254
254
255
nl::json interpreter::complete_request_impl (const std::string& code, int cursor_pos)
@@ -387,7 +388,7 @@ __get_cxx_version ()
387
388
388
389
void interpreter::init_includes ()
389
390
{
390
- Cpp::AddIncludePath ((xtl ::prefix_path () + " /include/" ).c_str ());
391
+ Cpp::AddIncludePath ((xeus ::prefix_path () + " /include/" ).c_str ());
391
392
}
392
393
393
394
void interpreter::init_preamble ()
0 commit comments