libcs update

master
Daniel Kolesa 2018-04-25 01:52:53 +02:00
parent a17bf0cedc
commit 20a7234dac
1 changed files with 4 additions and 4 deletions

View File

@ -32,10 +32,10 @@ static void rule_add(
string_range target, string_range depends, string_range target, string_range depends,
cs_bcode *body, bool action = false cs_bcode *body, bool action = false
) { ) {
cscript::util::ListParser p{cs, target}; cscript::util::list_parser p{cs, target};
while (p.parse()) { while (p.parse()) {
auto &rl = mk.rule(p.get_item()).action(action); auto &rl = mk.rule(p.get_item()).action(action);
cscript::util::ListParser lp{cs, depends}; cscript::util::list_parser lp{cs, depends};
while (lp.parse()) { while (lp.parse()) {
rl.depend(lp.get_item()); rl.depend(lp.get_item());
} }
@ -134,7 +134,7 @@ static void init_pathlib(cs_state &cs) {
string_range oldext = args[1].get_strr(); string_range oldext = args[1].get_strr();
string_range newext = args[2].get_strr(); string_range newext = args[2].get_strr();
std::string ret; std::string ret;
for (cscript::util::ListParser p{cs, args[0].get_strr()}; p.parse();) { for (cscript::util::list_parser p{cs, args[0].get_strr()}; p.parse();) {
ostd::path np{p.get_item()}; ostd::path np{p.get_item()};
if (!ret.empty()) { if (!ret.empty()) {
ret += ' '; ret += ' ';
@ -149,7 +149,7 @@ static void init_pathlib(cs_state &cs) {
cs.new_command("glob", "C", [](auto &cs, auto args, auto &res) { cs.new_command("glob", "C", [](auto &cs, auto args, auto &res) {
auto ret = ostd::appender<std::string>(); auto ret = ostd::appender<std::string>();
auto app = ostd::appender<std::vector<path>>();; auto app = ostd::appender<std::vector<path>>();;
for (cscript::util::ListParser p{cs, args[0].get_strr()}; p.parse();) { for (cscript::util::list_parser p{cs, args[0].get_strr()}; p.parse();) {
fs::glob_match(app, p.get_item()); fs::glob_match(app, p.get_item());
} }
ostd::format(ret, "%(%s %)", app.get()); ostd::format(ret, "%(%s %)", app.get());