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

Re: comments break \ at end of line



On Aug 25,  3:38pm, Adam Spiers wrote:
} Subject: Re: comments break \ at end of line
}
} I'm suggesting that, in the case of the function, it turns it into
} `echo hello, world', and in second case, it expects another line of
} input, just as if you hadn't entered the comment line.  After all,
} comment lines are supposed to be ignored, aren't they?

No, comment *lines* aren't supposed to be ignored.  *Comments* are
supposed to be ignored.  A comment is everything from the # up to BUT
NOT INCLUDING the newline.

If the comment included the newline, all sorts of parsing would go wrong:

if test foo # comment
then

Would become:

if test foo then

Which is certainly not what you meant.

A comment beginning in the first column is treated the same as a comment
beginning in any other column, which I think IS what you want; you don't
want the syntax of your program changed by the introduction of leading
whitespace, do you?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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