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

Re: lexing



A fruitful hunt for highlighting errors:

These are not mistaken as comments:

   #!/usr/bin/zsh
   ${(kv#)var}
   ${#var}
   $#var
   ${(s. # .)var}
   ${var// # /test}
   ${var//# /test}
   ${var%#}, ${var:-#}
   2#111
     '#', "#", \#
     `posh -c 'echo foo#bar'`


These are mistaken for comments:

   (#b)
   (#c1,2)
   (#a3)
   $[[#2]7]
   ##Z

... as are these:

   $(( ##\e )) is 27,
   (( #VAR ))
   $(( #var ))


... but, given that there is preceding whitespace, would these three not break Bart's rule? Perhaps the whitespace here is does not qualify as 'word separating'? Or is the " $(()) " construct an exception?

... and unfortunately:

    $(# this IS a comment).

is not considered to be a comment.



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