vile
[Top][All Lists]
Advanced

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

Re: [vile] Minor adjustments to scheme filtering


From: Thomas Dickey
Subject: Re: [vile] Minor adjustments to scheme filtering
Date: Sun, 22 Feb 2009 16:09:01 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

On Sat, Feb 21, 2009 at 08:41:16PM -0400, Brendan MacDonell wrote:
> Because the derived rnrs filter is so similar to the lisp filter, I'm
> almost tempted to think that the rnrs/lisp filters should be generated
> by some M4 / cpp magic, though I didn't include any such
> implementation in the patch for lack of a clue as to the most elegant
> way to go about it.

lex doesn't cooperate with the preprocessor inside the actions area
(which is where your difference is), but it's possible to use options
that control which states it uses.  I'd rather not add an m4 dependency,
since that would complicate the win32 port.

For instance, we could add "SCHEME" to the "%x" directive at the top,
and then do something like

<NORMAL>#{LPAREN}       { if (FltOptions('s')) {
                                int save = FLTSTACK_OK ? FLTSTACK_THIS.quoted : 
0;
                                push_state(SCHEME);
                                if (FLTSTACK_OK)
                                      FLTSTACK_THIS.quoted = save;
                                WriteToken(save ? paren_attr() : Error_attr);
                          } else {
                                WriteToken("");
                          }
                        }

But then - all of those places where we have <NORMAL>, and might also want
"SCHEME" would have to be modified to something like <NORMAL,SCHEME>.
It's doable, but a lot of clutter.

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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