|
|
@ -1,9 +1,3 @@
|
|
|
|
(identifier) @variable
|
|
|
|
|
|
|
|
;; In case you want type highlighting based on Julia naming conventions (this might collide with mathematical notation)
|
|
|
|
|
|
|
|
;((identifier) @type ; exception: mark `A_foo` sort of identifiers as variables
|
|
|
|
|
|
|
|
;(match? @type "^[A-Z][^_]"))
|
|
|
|
|
|
|
|
((identifier) @constant
|
|
|
|
|
|
|
|
(match? @constant "^[A-Z][A-Z_]{2}[A-Z_]*$"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
(triple_string)
|
|
|
|
(triple_string)
|
|
|
@ -28,43 +22,43 @@
|
|
|
|
(call_expression
|
|
|
|
(call_expression
|
|
|
|
(identifier) @function)
|
|
|
|
(identifier) @function)
|
|
|
|
(call_expression
|
|
|
|
(call_expression
|
|
|
|
(field_expression (identifier) @method .))
|
|
|
|
(field_expression (identifier) @function.method .))
|
|
|
|
(broadcast_call_expression
|
|
|
|
(broadcast_call_expression
|
|
|
|
(identifier) @function)
|
|
|
|
(identifier) @function)
|
|
|
|
(broadcast_call_expression
|
|
|
|
(broadcast_call_expression
|
|
|
|
(field_expression (identifier) @method .))
|
|
|
|
(field_expression (identifier) @function.method .))
|
|
|
|
(parameter_list
|
|
|
|
(parameter_list
|
|
|
|
(identifier) @parameter)
|
|
|
|
(identifier) @variable.parameter)
|
|
|
|
(parameter_list
|
|
|
|
(parameter_list
|
|
|
|
(optional_parameter .
|
|
|
|
(optional_parameter .
|
|
|
|
(identifier) @parameter))
|
|
|
|
(identifier) @variable.parameter))
|
|
|
|
(typed_parameter
|
|
|
|
(typed_parameter
|
|
|
|
(identifier) @parameter
|
|
|
|
(identifier) @variable.parameter
|
|
|
|
(identifier) @type)
|
|
|
|
(identifier) @type)
|
|
|
|
(type_parameter_list
|
|
|
|
(type_parameter_list
|
|
|
|
(identifier) @type)
|
|
|
|
(identifier) @type)
|
|
|
|
(typed_parameter
|
|
|
|
(typed_parameter
|
|
|
|
(identifier) @parameter
|
|
|
|
(identifier) @variable.parameter
|
|
|
|
(parameterized_identifier) @type)
|
|
|
|
(parameterized_identifier) @type)
|
|
|
|
(function_expression
|
|
|
|
(function_expression
|
|
|
|
. (identifier) @parameter)
|
|
|
|
. (identifier) @variable.parameter)
|
|
|
|
(spread_parameter) @parameter
|
|
|
|
(spread_parameter) @variable.parameter
|
|
|
|
(spread_parameter
|
|
|
|
(spread_parameter
|
|
|
|
(identifier) @parameter)
|
|
|
|
(identifier) @variable.parameter)
|
|
|
|
(named_argument
|
|
|
|
(named_argument
|
|
|
|
. (identifier) @parameter)
|
|
|
|
. (identifier) @variable.parameter)
|
|
|
|
(argument_list
|
|
|
|
(argument_list
|
|
|
|
(typed_expression
|
|
|
|
(typed_expression
|
|
|
|
(identifier) @parameter
|
|
|
|
(identifier) @variable.parameter
|
|
|
|
(identifier) @type))
|
|
|
|
(identifier) @type))
|
|
|
|
(argument_list
|
|
|
|
(argument_list
|
|
|
|
(typed_expression
|
|
|
|
(typed_expression
|
|
|
|
(identifier) @parameter
|
|
|
|
(identifier) @variable.parameter
|
|
|
|
(parameterized_identifier) @type))
|
|
|
|
(parameterized_identifier) @type))
|
|
|
|
|
|
|
|
|
|
|
|
;; Symbol expressions (:my-wanna-be-lisp-keyword)
|
|
|
|
;; Symbol expressions (:my-wanna-be-lisp-keyword)
|
|
|
|
(quote_expression
|
|
|
|
(quote_expression
|
|
|
|
(identifier)) @symbol
|
|
|
|
(identifier)) @string.special.symbol
|
|
|
|
|
|
|
|
|
|
|
|
;; Parsing error! foo (::Type) get's parsed as two quote expressions
|
|
|
|
;; Parsing error! foo (::Type) get's parsed as two quote expressions
|
|
|
|
(argument_list
|
|
|
|
(argument_list
|
|
|
@ -76,7 +70,7 @@
|
|
|
|
(identifier) @type)
|
|
|
|
(identifier) @type)
|
|
|
|
(parameterized_identifier (_)) @type
|
|
|
|
(parameterized_identifier (_)) @type
|
|
|
|
(argument_list
|
|
|
|
(argument_list
|
|
|
|
(typed_expression . (identifier) @parameter))
|
|
|
|
(typed_expression . (identifier) @variable.parameter))
|
|
|
|
|
|
|
|
|
|
|
|
(typed_expression
|
|
|
|
(typed_expression
|
|
|
|
(identifier) @type .)
|
|
|
|
(identifier) @type .)
|
|
|
@ -113,13 +107,13 @@
|
|
|
|
"end" @keyword
|
|
|
|
"end" @keyword
|
|
|
|
|
|
|
|
|
|
|
|
(if_statement
|
|
|
|
(if_statement
|
|
|
|
["if" "end"] @conditional)
|
|
|
|
["if" "end"] @keyword.control.conditional)
|
|
|
|
(elseif_clause
|
|
|
|
(elseif_clause
|
|
|
|
["elseif"] @conditional)
|
|
|
|
["elseif"] @keyword.control.conditional)
|
|
|
|
(else_clause
|
|
|
|
(else_clause
|
|
|
|
["else"] @conditional)
|
|
|
|
["else"] @keyword.control.conditional)
|
|
|
|
(ternary_expression
|
|
|
|
(ternary_expression
|
|
|
|
["?" ":"] @conditional)
|
|
|
|
["?" ":"] @keyword.control.conditional)
|
|
|
|
|
|
|
|
|
|
|
|
(function_definition ["function" "end"] @keyword.function)
|
|
|
|
(function_definition ["function" "end"] @keyword.function)
|
|
|
|
|
|
|
|
|
|
|
@ -134,47 +128,57 @@
|
|
|
|
"type"
|
|
|
|
"type"
|
|
|
|
] @keyword
|
|
|
|
] @keyword
|
|
|
|
|
|
|
|
|
|
|
|
((identifier) @keyword (#any-of? @keyword "global" "local"))
|
|
|
|
((identifier) @keyword (match? @keyword "global|local"))
|
|
|
|
|
|
|
|
|
|
|
|
(compound_expression
|
|
|
|
(compound_expression
|
|
|
|
["begin" "end"] @keyword)
|
|
|
|
["begin" "end"] @keyword)
|
|
|
|
(try_statement
|
|
|
|
(try_statement
|
|
|
|
["try" "end" ] @exception)
|
|
|
|
["try" "end" ] @keyword.control.exception)
|
|
|
|
(finally_clause
|
|
|
|
(finally_clause
|
|
|
|
"finally" @exception)
|
|
|
|
"finally" @keyword.control.exception)
|
|
|
|
(catch_clause
|
|
|
|
(catch_clause
|
|
|
|
"catch" @exception)
|
|
|
|
"catch" @keyword.control.exception)
|
|
|
|
(quote_statement
|
|
|
|
(quote_statement
|
|
|
|
["quote" "end"] @keyword)
|
|
|
|
["quote" "end"] @keyword)
|
|
|
|
(let_statement
|
|
|
|
(let_statement
|
|
|
|
["let" "end"] @keyword)
|
|
|
|
["let" "end"] @keyword)
|
|
|
|
(for_statement
|
|
|
|
(for_statement
|
|
|
|
["for" "end"] @repeat)
|
|
|
|
["for" "end"] @keyword.control.repeat)
|
|
|
|
(while_statement
|
|
|
|
(while_statement
|
|
|
|
["while" "end"] @repeat)
|
|
|
|
["while" "end"] @keyword.control.repeat)
|
|
|
|
(break_statement) @repeat
|
|
|
|
(break_statement) @keyword.control.repeat
|
|
|
|
(continue_statement) @repeat
|
|
|
|
(continue_statement) @keyword.control.repeat
|
|
|
|
(for_binding
|
|
|
|
(for_binding
|
|
|
|
"in" @repeat)
|
|
|
|
"in" @keyword.control.repeat)
|
|
|
|
(for_clause
|
|
|
|
(for_clause
|
|
|
|
"for" @repeat)
|
|
|
|
"for" @keyword.control.repeat)
|
|
|
|
(do_clause
|
|
|
|
(do_clause
|
|
|
|
["do" "end"] @keyword)
|
|
|
|
["do" "end"] @keyword)
|
|
|
|
|
|
|
|
|
|
|
|
(export_statement
|
|
|
|
(export_statement
|
|
|
|
["export"] @include)
|
|
|
|
["export"] @keyword.control.import)
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"using"
|
|
|
|
"using"
|
|
|
|
"module"
|
|
|
|
"module"
|
|
|
|
"import"
|
|
|
|
"import"
|
|
|
|
] @include
|
|
|
|
] @keyword.control.import
|
|
|
|
|
|
|
|
|
|
|
|
((identifier) @include (#eq? @include "baremodule"))
|
|
|
|
((identifier) @keyword.control.import (#eq? @keyword.control.import "baremodule"))
|
|
|
|
|
|
|
|
|
|
|
|
(((identifier) @constant.builtin) (match? @constant.builtin "^(nothing|Inf|NaN)$"))
|
|
|
|
(((identifier) @constant.builtin) (match? @constant.builtin "^(nothing|Inf|NaN)$"))
|
|
|
|
(((identifier) @boolean) (eq? @boolean "true"))
|
|
|
|
(((identifier) @constant.builtin.boolean) (#eq? @constant.builtin.boolean "true"))
|
|
|
|
(((identifier) @boolean) (eq? @boolean "false"))
|
|
|
|
(((identifier) @constant.builtin.boolean) (#eq? @constant.builtin.boolean "false"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
["::" ":" "." "," "..." "!"] @punctuation.delimiter
|
|
|
|
["::" ":" "." "," "..." "!"] @punctuation.delimiter
|
|
|
|
["[" "]" "(" ")" "{" "}"] @punctuation.bracket
|
|
|
|
["[" "]" "(" ")" "{" "}"] @punctuation.bracket
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
["="] @operator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(identifier) @variable
|
|
|
|
|
|
|
|
;; In case you want type highlighting based on Julia naming conventions (this might collide with mathematical notation)
|
|
|
|
|
|
|
|
;((identifier) @type ; exception: mark `A_foo` sort of identifiers as variables
|
|
|
|
|
|
|
|
;(match? @type "^[A-Z][^_]"))
|
|
|
|
|
|
|
|
((identifier) @constant
|
|
|
|
|
|
|
|
(match? @constant "^[A-Z][A-Z_]{2}[A-Z_]*$"))
|
|
|
|