vile
[Top][All Lists]
Advanced

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

[vile] Minor adjustments to scheme filtering


From: Brendan MacDonell
Subject: [vile] Minor adjustments to scheme filtering
Date: Sat, 21 Feb 2009 20:41:16 -0400

Recently I got back to using scheme regularly, and noted that some
literals weren't supported by the syntax highlighter. Some quick
modifications and a fork from lispfilt.l later, and I think I've
managed to cover all of the bases regarding the vector, quasiquote,
quote, unquote, and unquote-splice literals. I'm afraid I have little
experience in the realm of Common Lisp, but a quick look at wikipedia
leads me to believe that most of the changes also apply to the lisp
filter as well. As such, attached is a patch which does the following:

Lisp/Scheme:
* Adds highlighting support for quasiquote/backtick (`), quote ('),
unquote (,) and unquote-splice (,@), including unquoted
sub-expressions.
* Highlights the parentheses of quoted expressions in a different
color (glancing at the code, this appears to have been the initial
intent, except the 'quoted' stack variable was never initialized to
zero). It remains to be seen whether it might be a good idea to also
visually differentiate between quoted and quasiquoted expressions as
Vim does.

Scheme:
* Uses a derived filter, 'rnrs' (I tried naming the filter 'scheme',
but apparently define_scheme is already defined by vile itself).
* Highlights vector literals '#( .. )' properly depending on their context.
* Removes the tokens from scheme.key which are now handled by the filter.
* Cleans up the keywords file by disabling the unnecessary .brief and
.abbrev declarations. This also allows some forgotten let*-style
keywords to be properly recognized.

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.

Brendan MacDonell

Attachment: lisp-filters.diff.gz
Description: GNU Zip compressed data


reply via email to

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