2016-09-01 16:42:28 +00:00
|
|
|
#ifndef CS_REPL_HAS_EDIT
|
|
|
|
/* use nothing (no line editing support) */
|
|
|
|
|
2017-01-30 18:38:11 +00:00
|
|
|
#include <optional>
|
|
|
|
|
2016-09-01 16:42:28 +00:00
|
|
|
#include <ostd/string.hh>
|
|
|
|
|
2017-02-16 18:07:22 +00:00
|
|
|
static void init_lineedit(cs_state &, ostd::string_range) {
|
2016-09-01 16:42:28 +00:00
|
|
|
}
|
|
|
|
|
2017-02-13 17:10:40 +00:00
|
|
|
static std::optional<std::string> read_line(cs_state &, cs_svar *pr) {
|
2016-09-01 16:42:28 +00:00
|
|
|
ostd::write(pr->get_value());
|
2017-01-30 00:18:55 +00:00
|
|
|
std::string ret;
|
2016-09-01 16:42:28 +00:00
|
|
|
/* i really need to implement some sort of get_line for ostd streams */
|
|
|
|
for (char c = ostd::in.getchar(); c && (c != '\n'); c = ostd::in.getchar()) {
|
|
|
|
ret += c;
|
|
|
|
}
|
2017-01-25 00:57:33 +00:00
|
|
|
return std::move(ret);
|
2016-09-01 16:42:28 +00:00
|
|
|
}
|
|
|
|
|
2017-02-16 18:07:22 +00:00
|
|
|
static void add_history(cs_state &, ostd::string_range) {
|
2016-09-01 16:42:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|