- msg (SE, _("No matching INPUT PROGRAM command."));
- return CMD_CASCADING_FAILURE;
+ enum cmd_result result = cmd_parse_in_state (lexer, ds, CMD_STATE_INPUT_PROGRAM);
+ if (result == CMD_END_INPUT_PROGRAM)
+ break;
+ else if (result == CMD_END_CASE)
+ {
+ emit_END_CASE (ds, inp);
+ saw_END_CASE = true;
+ }
+ else if (cmd_result_is_failure (result) && result != CMD_FAILURE)
+ {
+ if (result == CMD_EOF)
+ msg (SE, _("Unexpected end-of-file within INPUT PROGRAM."));
+ inside_input_program = false;
+ proc_discard_active_file (ds);
+ destroy_input_program (inp);
+ return result;
+ }