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

Syntax highlighting in joe for zsh

    Hi all :)

    The "joe" editor comes with a syntax highlighting file for
sh/ksh/bash, but I find it not enough for zsh, so I'm writing a
(IMHO) better syntax file for our beloved shell ;) This syntax file
gives JOE the ability to show colors when editing ZSH scripts.

    Of course I can use the provided syntax file for sh as a base and
modify it, but I prefer to write it from scratch to optimize the DFA
for zsh (JOE syntax files are really a DFA). For that I would need
some help, not with the file itself (I'll write it, no problemo), but
with allowed syntaxes for zsh.

    The help I need for this can come in two flavors ;) One of them,
the first option, is to have a formal definition (in BNF syntax or
something like that) of the ZSH language, something like the things
we can find in the manual under "Shell Grammar", but more formal.
Then I'll try to translate that BNF grammar into the DFA that the
editor wants.

    The other option is a bit less complete but much simpler,
assuming that the people on the list won't get tired soon ;) I can
ask in the list for valid syntaxes for a given class of tokens, and
improve the syntax file for that tokens. For example, the first
revision of the syntax file will just distinguish comments and will
ONLY color comments, leaving the rest of the script without colors.
After that I can add "keyword" detection and colorize keywords, after
that I can add loops, etc... The problem with this approach is that I
will have to ask the list frequently and I don't want to be annoying
(I think I'm annoying enough just asking my usual questions).

    So please, if anyone is interested in this issue tell me which
options do you think is the best. I'll make available the syntax file
from my web site. If nobody is interested I'll write the syntax file
to properly colorize my scripts, improving it over time and trying
to keep my questions about syntax on the list as low as I can.

    Thanks a lot in advance :)

    Raúl Núñez de Arenas Coronado

Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...

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