@@ -0,0 +1,180 @@
2+;; In case you want type highlighting based on Julia naming conventions (this might collide with mathematical notation)
3+;((identifier) @type ; exception: mark `A_foo` sort of identifiers as variables
4+ ;(match? @type "^[A-Z][^_]"))
5+((identifier) @constant
6+ (match? @constant "^[A-Z][A-Z_]{2}[A-Z_]*$"))
14+ prefix: (identifier) @constant.builtin)
16+(macro_identifier) @function.macro
17+(macro_identifier (identifier) @function.macro) ; for any one using the variable highlight
19+ name: (identifier) @function.macro
20+ ["macro" "end" @keyword])
24+ (identifier) @field .)
27+ name: (identifier) @function)
29+ (identifier) @function)
31+ (field_expression (identifier) @method .))
32+(broadcast_call_expression
33+ (identifier) @function)
34+(broadcast_call_expression
35+ (field_expression (identifier) @method .))
37+ (identifier) @parameter)
39+ (optional_parameter .
40+ (identifier) @parameter))
42+ (identifier) @parameter
47+ (identifier) @parameter
48+ (parameterized_identifier) @type)
50+ . (identifier) @parameter)
51+(spread_parameter) @parameter
53+ (identifier) @parameter)
55+ . (identifier) @parameter)
58+ (identifier) @parameter
62+ (identifier) @parameter
63+ (parameterized_identifier) @type))
65+;; Symbol expressions (:my-wanna-be-lisp-keyword)
67+ (identifier)) @symbol
69+;; Parsing error! foo (::Type) get's parsed as two quote expressions
73+ (identifier) @type)))
77+(parameterized_identifier (_)) @type
79+ (typed_expression . (identifier) @parameter))
82+ (identifier) @type .)
84+ (parameterized_identifier) @type .)
87+ name: (identifier) @type)
96+ (eq? @number "end")))
97+(coefficient_expression
99+ (identifier) @constant.builtin)
102+;; Those are a bit difficult to implement since the respective nodes are hidden right now (_power_operator)
103+;; and heavily use Unicode chars (support for those are bad in vim/lua regexes)
109+ ;(comparison_operator);
116+ ["if" "end"] @conditional)
118+ ["elseif"] @conditional)
120+ ["else"] @conditional)
122+ ["?" ":"] @conditional)
124+(function_definition ["function" "end"] @keyword.function)
137+((identifier) @keyword (#any-of? @keyword "global" "local"))
140+ ["begin" "end"] @keyword)
142+ ["try" "end" ] @exception)
144+ "finally" @exception)
148+ ["quote" "end"] @keyword)
150+ ["let" "end"] @keyword)
152+ ["for" "end"] @repeat)
154+ ["while" "end"] @repeat)
155+(break_statement) @repeat
156+(continue_statement) @repeat
162+ ["do" "end"] @keyword)
165+ ["export"] @include)
173+((identifier) @include (#eq? @include "baremodule"))
175+(((identifier) @constant.builtin) (match? @constant.builtin "^(nothing|Inf|NaN)$"))
176+(((identifier) @boolean) (eq? @boolean "true"))
177+(((identifier) @boolean) (eq? @boolean "false"))
179+["::" ":" "." "," "..." "!"] @punctuation.delimiter
180+["[" "]" "(" ")" "{" "}"] @punctuation.bracket