Syntax highlighting



I have written a language where operations on content are specified in brackets, like this:

[a content]

The brackets can appear anywhere on a line, and they can be nested.

I would *like* to have the brackets one color, the keyword ('a' in the above example) another color, and the remainder another color.

I want the keywords to stand out, but the braces separately obvious for visual matching purposes without having to put the cursor on them.

This *almost* works...

context default brightgreen
    keyword [ brightmagenta
    keyword ] brightmagenta

context exclusive [ ] brightgreen                   
    keyword [ brightmagenta                 
    keyword ] brightmagenta
    keyword whole a white

...in that this...

[a foo bar]

...displays correctly, the 'a' in bar not highlighting in white.

But this makes BOTH occurrences of 'a' white...

[a this is a test]

...where the first 'a' is a keyword, as easily distinguished by it following the opening bracket, but the second 'a' is not, as it does not follow an opening bracket.

Anyone have any idea if this can be made to work?

Any assistance much appreciated.

The email address in the syntax highlighting file for Paul, the author of the syntax stuff, bounces, no big surprise, sigh.



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