Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Inconsistent parse error output



% done; foo
zsh: parse error near `done'
% :; done; foo
zsh: parse error near `done'
% if; done; foo
zsh: parse error near `done'
% if; then done; foo
zsh: parse error near `foo'
%

I would've expected that last one to produce the same error output as
the previous ones.

This can lead to confusing output when the parse error occurs in a file:

% > tst << EOF
if :; then
  :
done

# lots
# of
# comments

foo
EOF
% source tst
tst:9: parse error near `foo'
%




Messages sorted by: Reverse Date, Date, Thread, Author