chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] [PATCH] Fix -no-parentheses-synonyms and -no-symbol-esca


From: Peter Bex
Subject: [Chicken-users] [PATCH] Fix -no-parentheses-synonyms and -no-symbol-escapes (was: Re: -no-parentheses-synonyms broken?)
Date: Fri, 30 Aug 2013 17:01:03 +0200
User-agent: Mutt/1.4.2.3i

On Fri, Aug 30, 2013 at 09:39:19AM +0200, Peter Bex wrote:
> On Fri, Aug 30, 2013 at 01:17:40AM -0600, Matt Gushee wrote:
> > and Chicken by default
> > treats square brackets as equivalent to parentheses. So I wanted to
> > see what would happen if I used csi -no-parentheses-synonyms. But it
> > seems that option has no effect.
> 
> It looks like you've indeed found a bug.  I've done some tests, and
> passing -r5rs-syntax seems to disable the paren synonyms correctly.
> I don't see why a lone -no-parentheses-synonyms shouldn't do the
> job; they access the same parameter behind the scenes.  Anyway, I'll
> look into the code behind this later.  Thanks for reporting it!

It turned out that -no-symbol-escape was also broken, due to an
incorrect overcomplicated 4-way if-expression which determined the
reserved characters depending on whether -no-symbol-escape or
-no-parentheses-synonyms was supplied.

Here's a fix for this, with some regression tests to ensure this won't
break again.

I've hopefully simplified it enough to make it "obviously correct".
I also noticed that even after correcting the test, pipes occurring
inside symbols were still allowed, so I've also fixed this by adding
an additional check (the "sep" check was wrong so I ripped it out).

Cheers,
Peter
-- 
http://www.more-magic.net

Attachment: 0001-Fix-handling-of-no-symbol-escape-and-no-parentheses-.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]