|
|
@ -85,8 +85,11 @@
|
|
|
|
; Function definition
|
|
|
|
; Function definition
|
|
|
|
; -------------------
|
|
|
|
; -------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
(function_definition
|
|
|
|
(function_definition
|
|
|
|
name: (identifier) @function)
|
|
|
|
name: (identifier) @function)
|
|
|
|
|
|
|
|
; prevent constructors (PascalCase) to be highlighted as functions
|
|
|
|
|
|
|
|
(#match? @function "^[^A-Z]"))
|
|
|
|
|
|
|
|
|
|
|
|
(parameter_list
|
|
|
|
(parameter_list
|
|
|
|
(identifier) @variable.parameter)
|
|
|
|
(identifier) @variable.parameter)
|
|
|
@ -108,17 +111,26 @@
|
|
|
|
; Functions calls
|
|
|
|
; Functions calls
|
|
|
|
; ---------------
|
|
|
|
; ---------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
(call_expression
|
|
|
|
(call_expression
|
|
|
|
(identifier) @function)
|
|
|
|
(identifier) @function)
|
|
|
|
|
|
|
|
; prevent constructors (PascalCase) to be highlighted as functions
|
|
|
|
|
|
|
|
(#match? @function "^[^A-Z]"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
(broadcast_call_expression
|
|
|
|
(broadcast_call_expression
|
|
|
|
(identifier) @function)
|
|
|
|
(identifier) @function)
|
|
|
|
|
|
|
|
(#match? @function "^[^A-Z]"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
(call_expression
|
|
|
|
(call_expression
|
|
|
|
(field_expression (identifier) @function .))
|
|
|
|
(field_expression (identifier) @function .))
|
|
|
|
|
|
|
|
(#match? @function "^[^A-Z]"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
(broadcast_call_expression
|
|
|
|
(broadcast_call_expression
|
|
|
|
(field_expression (identifier) @function .))
|
|
|
|
(field_expression (identifier) @function .))
|
|
|
|
|
|
|
|
(#match? @function "^[^A-Z]"))
|
|
|
|
|
|
|
|
|
|
|
|
; ------
|
|
|
|
; ------
|
|
|
|
; Macros
|
|
|
|
; Macros
|
|
|
@ -228,19 +240,25 @@
|
|
|
|
; Remaining identifiers
|
|
|
|
; Remaining identifiers
|
|
|
|
; ---------------------
|
|
|
|
; ---------------------
|
|
|
|
|
|
|
|
|
|
|
|
; could also be namespace but this should cover the majority
|
|
|
|
|
|
|
|
(field_expression
|
|
|
|
|
|
|
|
. (_)
|
|
|
|
|
|
|
|
(identifier) @variable.other.member)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(const_statement
|
|
|
|
(const_statement
|
|
|
|
(variable_declaration
|
|
|
|
(variable_declaration
|
|
|
|
. (identifier) @constant))
|
|
|
|
. (identifier) @constant))
|
|
|
|
|
|
|
|
|
|
|
|
((identifier) @type
|
|
|
|
; SCREAMING_SNAKE_CASE
|
|
|
|
(match? @type "([A-Z][a-z0-9]+)+$"))
|
|
|
|
(
|
|
|
|
|
|
|
|
(identifier) @constant
|
|
|
|
|
|
|
|
(match? @constant "^[A-Z][A-Z0-9_]*$"))
|
|
|
|
|
|
|
|
|
|
|
|
((identifier) @constant
|
|
|
|
; remaining identifiers that start with capital letters should be types (PascalCase)
|
|
|
|
(match? @constant "^[A-Z][A-Z0-9_]+$"))
|
|
|
|
(
|
|
|
|
|
|
|
|
(identifier) @type
|
|
|
|
|
|
|
|
(match? @type "^[A-Z]"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Field expressions are either module content or struct fields.
|
|
|
|
|
|
|
|
; Module types and constants should already be captured, so this
|
|
|
|
|
|
|
|
; assumes the remaining identifiers to be struct fields.
|
|
|
|
|
|
|
|
(field_expression
|
|
|
|
|
|
|
|
(_)
|
|
|
|
|
|
|
|
(identifier) @variable.other.member)
|
|
|
|
|
|
|
|
|
|
|
|
(identifier) @variable
|
|
|
|
(identifier) @variable
|
|
|
|