Compare commits

...

2 Commits

Author SHA1 Message Date
Kelvin Sherlock f799eb6d81 allow break within loop ... end 2022-11-23 18:26:30 -05:00
Kelvin Sherlock 298c601300 include trailing text with the ) token so redirection works correctly 2022-11-23 18:18:32 -05:00
2 changed files with 8 additions and 2 deletions

View File

@ -716,7 +716,7 @@ int loop_command::execute(Environment &env, const fdmask &fds, bool throwup) {
if (control_c) throw execution_of_input_terminated();
try {
env.indent_and([&]{
env.loop_indent_and([&]{
rv = vector_command::execute(env, newfds);
});
}

View File

@ -60,6 +60,7 @@
}
}
action parse_lparen {
if (scratch.empty()) {
parse(LPAREN, "(");
@ -71,7 +72,8 @@
action parse_rparen {
if (pcount <= 0) {
flush();
parse(RPAREN, ")");
// parse(RPAREN, ")");
scratch.push_back(fc);
fgoto main;
}
--pcount;
@ -179,6 +181,10 @@ int phase2::classify() {
%%write data;
if (type) return type;
if (scratch.front() == ')') {
type = RPAREN;
return type;
}
std::string argv0;
const unsigned char *p = (const unsigned char *)scratch.data();