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_active"
"foreach_unique"
] @repeat
] @keyword.control.repeat
[
"cif"
] @conditional
"cif" @keyword.control.conditional
[
"varying"
"uniform"
] @type.qualifier
] @keyword.storage.modifier
"__regcall" @attribute
@ -90,7 +88,7 @@
; standard library built-in
((type_identifier) @type.builtin
(#lua-match? @type.builtin "^RNGState"))
(#match? @type.builtin "^RNGState"))
(call_expression
function: (identifier) @function.builtin

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

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

Loading…
Cancel
Save