jed-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Cryptic world of Jed programming modes


Hi, everyone. I'm a longtime Jed user, recent list subscriber.

I'm writing because I'm working on a programming mode for the CRM114
Discriminator programming language (http://crm114.sf.net/). CRM114 has a
very simple syntax, made up of commands with keywords, followed by
arguments delimited by (), [], <>, and //. Statements can be organized
into blocks using curly brackets {}, and comments start with a # and go
to the end of the line. Here's an example:

{
    match [:show:] /.+/
    {
        {
            match [:show:] /SET/
            # No var specified, dump all
            isolate (:var: :value:)
            isolate (:varrest:) /:*:configvars:/
            {
                match <fromend> (:var:) [:varrest:] /[^ ]+/
                {
                    match (:value:) [::*:var::] /.*/
                    output /:*:var: :*:value:\n/
                }
                liaf
            }
        }
        alius
        {
            match [:configvars:] /:*:show:/
            isolate (:showval:) //

            match (:showval:) [::*:show::] /.*/
            output /:*:showval:\n/
        }
        alius
        {
            fault /No such config variable ":*:show:".\n/
        }
    }

    exit /0/
}

I've gotten pretty far with some voodoo programming -- copying stuff
from other modes. My crm114.sl mode is available here:

        http://bad.dynu.ca/~evan/crm114mode/crm114mode-0.1.tar.gz

There are three main things I can't seem to figure out how to do:

     1. I've got indentation going, but I can't seem to make closing
        curly braces ("}") line up with their matching opening brace.
     2. I'm not sure how to make comments line up with the preceding
        statement.
     3. Some modes have weird prefixes to the names of colors in
        define_highlight_rule(), like "Knormal" or "PQstring". I haven't
        seen any documentation on what the K or P or Q does. Any
        suggestions?

Any other help, comments, or suggestions highly appreciated.

~ESP

-- 
Evan Prodromou                  .O.
http://bad.dynu.ca/~evan/       ..O
evan@xxxxxxxxxxx                OOO

[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]