eliminate remaining cs_string

master
Daniel Kolesa 2021-03-19 22:35:39 +01:00
parent fece7ce769
commit 2e725771e4
3 changed files with 4 additions and 6 deletions

View File

@ -546,7 +546,7 @@ OSTD_EXPORT void list_find_item(cs_list_parse_state &ps) {
OSTD_EXPORT cs_strref value_list_concat(
cs_state &cs, cs_value_r vals, ostd::string_range sep
) {
auto app = ostd::appender<cs_string>();
auto app = ostd::appender<cs_charbuf>(cs);
for (std::size_t i = 0; i < vals.size(); ++i) {
switch (vals[i].get_type()) {
case cs_value_type::INT:
@ -564,7 +564,7 @@ OSTD_EXPORT cs_strref value_list_concat(
}
ostd::range_put_all(app, sep);
}
return cs_strref{cs, ostd::iter(app.get())};
return cs_strref{cs, app.get().str()};
}
} /* namespace cscript */

View File

@ -15,8 +15,6 @@ using cs_map = std::unordered_map<K, V>;
template<typename T>
using cs_vector = std::vector<T>;
using cs_string = std::string;
cs_int cs_parse_int(
ostd::string_range input, ostd::string_range *end = nullptr
);

View File

@ -1036,9 +1036,9 @@ void cs_init_lib_base(cs_state &gcs) {
} catch (cs_error const &e) {
result.set_str(e.what());
if (e.get_stack().get()) {
auto app = ostd::appender<cs_string>();
auto app = ostd::appender<cs_charbuf>(cs);
cscript::util::print_stack(app, e.get_stack());
tback.set_str(app.get());
tback.set_str(app.get().str());
}
rc = false;
}