help-octave
[Top][All Lists]
Advanced

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

Syntax highlight with gtksourceview testers/feedback welcomed


From: Carnë Draug
Subject: Syntax highlight with gtksourceview testers/feedback welcomed
Date: Tue, 9 Mar 2010 03:16:16 +0000

Hi

I picked up the language file from gtksourceview and tried to extend
it. I hope others user enjoy it. Here's the main changes I made

*On continuation lines
        ... is also identified as a continuation line character
        continuation lines characters are ignored if they are between single
quotes only

*On comments
        comments can be made after the continuation line characters
        added shebang line (it's no longer just a comment line)

*On functions
        added all functions (I hope). Just removed "ans" (mapped it to an
identifier) and "pkg" (mapped it to preprocessor). I don't know what
1/10 of them do. Just like "ans" and "pkg", there's probably more that
shouldn't be there and I just don't know about it. If you can point
them out I'd be most thankful

*On metadata
        added block comment "start" and "end" to the list (can someone test
this please? I don't know any editor that uses this)

*On operators
        there's syntax for operators now. I tried to be careful with the
transpose operator. Should map all of them
        what's the thing with - and +? When do they define the signal instead
of being operators? Should they be considered numbers in those
situations?

*On strings
        added a printf regexp that should identify the formatting
        added a escape regexp that should escape only some stuff, not what's
right after an \

I'll submit to the gtksourceview developers after I get some feedback
from you which may or may not, take me to make some changes. If you
use this for syntax highlight, please try it and give your opinions. I
started using octave recently so I may have messed up some things.
Please tell me what's wrong with it so I can make it better. Some of
the things I'm more in doubt are:

* the use of escape and format inside single and double quotes. It
seems that in printf the single string still allow escapes, but not
when assigninig.
* the list of functions
* some reserved keywords, like NaN are also functions. Should I refine
the regexp to see if they are followed by parenthesis and are
therefore functions instead of a constant
* should I list all the pkg options instead of just highlight
everything after pkg?
* use of + and - as signal of the numbers instead of arithmetic operators
* the metadata about block comments

Any help will be most welcome and I hope this can be of any use for
the rest of the community. Thanks in advance,

Carnë Draug

Note: I studied the lang files from perl and C to change the one for
octave. I copied the regexp for printf and escaped characters from the
C lang files

Attachment: octave.lang
Description: Binary data


reply via email to

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