ispc: Improve custom highlight, indent and local scopes

pull/8678/head
Marijn Suijten 10 months ago committed by Marijn Suijten
parent b352f180ab
commit d8141a3df0
No known key found for this signature in database
GPG Key ID: 23E7CB3F180C39F2

@ -24,16 +24,14 @@
"foreach_tiled" "foreach_tiled"
"foreach_active" "foreach_active"
"foreach_unique" "foreach_unique"
] @repeat ] @keyword.control.repeat
[ "cif" @keyword.control.conditional
"cif"
] @conditional
[ [
"varying" "varying"
"uniform" "uniform"
] @type.qualifier ] @keyword.storage.modifier
"__regcall" @attribute "__regcall" @attribute
@ -90,7 +88,7 @@
; standard library built-in ; standard library built-in
((type_identifier) @type.builtin ((type_identifier) @type.builtin
(#lua-match? @type.builtin "^RNGState")) (#match? @type.builtin "^RNGState"))
(call_expression (call_expression
function: (identifier) @function.builtin function: (identifier) @function.builtin

@ -1,7 +1,11 @@
; inherits: c ; inherits: c
((foreach_statement body: (_) @_body) @indent.begin (foreach_statement
(#not-has-type? @_body compound_statement)) body: (_) @indent
(#not-kind-eq? @indent "compound_statement")
(#set! "scope" "all"))
((foreach_instance_statement body: (_) @_body) @indent.begin (foreach_instance_statement
(#not-has-type? @_body compound_statement)) body: (_) @indent
(#not-kind-eq? @indent "compound_statement")
(#set! "scope" "all"))

@ -1,17 +1,26 @@
; inherits: c ; inherits: c
(reference_declarator ; Scopes
(identifier) @definition.var)
(type_parameter_declaration
(type_identifier) @definition.type)
(template_declaration) @scope
(template_function (template_function
name: (identifier) @definition.function) @scope name: (identifier) @local.definition) @local.scope
[ [
(foreach_statement) (foreach_statement)
(foreach_instance_statement) (template_declaration)
(unmasked_statement) (unmasked_statement)
] @scope ] @local.scope
; Definitions
(reference_declarator
(identifier) @local.definition)
(type_parameter_declaration
(type_identifier) @local.definition)
(foreach_statement
range_start: (assignment_expression
left: (identifier) @local.definition))
(foreach_instance_statement
initializer: (identifier) @local.definition)
; References
(type_identifier) @local.reference

Loading…
Cancel
Save