Clean up the return type of parser_t::eval

parser_t::eval indicates whether there was a parse error. It can be
easily confused with the status of the execution. Use a real type to
make it more clear.
This commit is contained in:
ridiculousfish
2019-12-17 15:39:05 -08:00
parent 4f3b3f7d61
commit 09f8e05b80
6 changed files with 52 additions and 34 deletions

View File

@@ -254,7 +254,8 @@ int run_command_list(std::vector<std::string> *cmds, const io_chain_t &io) {
for (const auto &cmd : *cmds) {
const wcstring cmd_wcs = str2wcstring(cmd);
res = parser.eval(cmd_wcs, io, TOP);
eval_result_t eval_res = parser.eval(cmd_wcs, io, TOP);
res = (eval_res == eval_result_t::ok ? 0 : 1);
}
return res;