From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7392 invoked by alias); 30 Nov 2015 02:10:36 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21013 Received: (qmail 20111 invoked from network); 30 Nov 2015 02:10:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Authority-Analysis: v=2.1 cv=X+5rdgje c=1 sm=1 tr=0 a=Uh/wpEIUX9UX0FOdpsyW1Q==:117 a=Uh/wpEIUX9UX0FOdpsyW1Q==:17 a=N659UExz7-8A:10 a=hJiZXizUFEM-UJqLf3UA:9 a=pILNOxqGKmIA:10 Message-id: <565BB016.6020905@eastlink.ca> Date: Sun, 29 Nov 2015 18:10:30 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: lexing References: <565B18C6.6090707@eastlink.ca> <151129100735.ZM24525@torch.brasslantern.com> In-reply-to: <151129100735.ZM24525@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 11/29/2015 10:07 AM, Bart Schaefer wrote: > The # character introduces a comment ONLY when it is immediately > preceded by a command terminator (including start of line) or by > whitespace that acts as a word separator. Ok, so the comment is actually the exception. That spares me going through ZyX's list and seeing which of them is highlighted wrong. I expect there's a big overlap with bash rules anyway, so we're only interested in exceptions from bash. > Everywhere else, # is NOT a comment, in contexts such as: Yeah, I know the hash is used all over the place, but I've only noticed the " (#...) " error so far, tho I suppose I should check all the other candidates. > The form you're using (#something), is only not-a-comment in pattern > or filename-generation context, so $(# this IS a comment). When will I run out of things that astonish me about zsh syntax? What sort of need would there be to put a comment inside " $(#...) " ? So that's a comment but " (#b) " is not a comment ... sometimes, but don't bet on it. > Final note: The one thing zsh borrowed from csh that I freely concede > is pretty horrible, is the ability to change the comment character by > changing the third character of $histchars. Please never do this. Pardon the mini-rant, but that's demented. So the whole edifice of zsh lexing, all the stuff mentioned, and everything else, has to be filtered thu some engine that first determines if the comment character has been changed? Changed to what? What character is 'free' for assumption as the comment marker? I don' t know if I'll ever understand. >