Hi again guys, I've made a small update to the highlighter, it should now work better with brackets in lookups, and it should also highlight the new mouse button names of the SDL2 ports as correct; which are now MOUSELEFT and friends as opposed to MOUSE1 and friends.


Anyhoo, I'd appreciate some tips and advice on the todo list items.

First there's the case of the reserved references, I can get $[numargs] to highlight properly, but not $numargs, any ideas what I can do in this vein? I'm assuming the <keyword> tag is attempting a match against the $ (or @ as the case may be) as well.


secondly, I wish to add proper support for the shader commands; it's essentially vanilla GLSL, only it has CubeScript sprinkled about to generate significant parts of the shader; basically as though it's a shader processing language.
The CubeScript witchcraft is used to generate code, and to take the place of what would ordinarily be #ifdef and #define statements.

A basic shader with variants would typically look something like this.

myshader = [
    shader 0 [myshader_@arg1] [
        attribute vec4 vvertex;
        void main()
        {
            @(if (strstr $arg1 "f") [ result [
                gl_Position = vec4(0, 0, 0, 0);
            ]] [ result [
                gl_Position = vvertex;
            ]])
        }
    ] [
        fragdata(0, fragcolor, vec4)
        void main(void)
        {
            @(if (strstr $arg1 "p") [ result [
                fragcolor = vec4(1.0, 0.0, 1.0, 1.0);
            ]] [ result [
                fragcolor = vec4(1.0, 1.0, 1.0, 1.0);
            ]])
        }
    ]
]

myshader "p"
myshader "f"
myshader "fp"


Would I be able to do this by leveraging the existing GLSL file for my uses, or will I be best served by making a tailored highlighter myself for the GLSL sections?

Regards
~Kevin Meyer


--e89a8ff255c2153dbf04da4baf06--