Here is a small test from the syntax highlighter I was working on:
alias singleLineCommentTest {
; comment
echo -s test 1
; comment | echo -s test 2
; comment | echo -s test 3 | ;comment |
{ ; comment } | echo -s test 4
{ ; comment | } | echo -s test 5
{ ; comment | echo -s test 6 } | ; comment | echo -s test 7
{ echo -s test 8 | ; comment } | echo -s test 9
{ echo -s test 10 | ; comment | } | echo -s test 11
echo -s test 12 | ; comment | echo -s test 13
echo -s test 14 |
echo -s test 15 |
; comment | { echo -s test 16 }
}
Calling the command will output:
test 1
test 4
test 8
test 10
test 12
test 13
test 14
test 15 |
What I got for my test:
1. If a line starts with a comment, the line is treated as a comment line.
2. If a comment is between a line, with the help of pipes, then only said part of the line is treated as a comment.
My second conclusion does have an exception, shown by:
{ echo -s test 8 | ; comment } | echo -s test 9
outputs test 8, but not test 9
where as:
{ ; comment } | echo -s test 4
outputs test 4
Hope this helps a bit, I will edit this reply as soon as I do more test and/or find out extra information.