Sublime Forum

Sublime Syntax: Use variables in anonymous prototype

#1

Hey,

I tried to use a variable for matching inside an anonymous prototype.
The following variable was declared:

types_cg: 'float[2-4]'

In my main context I have the following construct:

  - comment: CGPROGRAM
    match: CGPROGRAM
    push: cgprogram_main
    with_prototype:
      - match: '{{types_cg}}'
        scope: storage.type.source.unity_shader
      - match: (?=ENDCG)
        pop: true
        
  cgprogram_main:
    - include: scope:source.c++

This does not assign the correct scope to float2,3 or 4 variables.

However when I replace the variable match with the actual value of the variable it works.

Did I do something wrong?

0 Likes

#2

Variables are currently not supported in with_prototype sections unfortunately:

1 Like

#3

Thanks for the fast help. I wrote a comment in the issue. Maybe it will be fixed soon.

0 Likes