@@ -122,13 +122,17 @@ Otherwise, the indentation is:
122
122
'((t :inherit font-lock-constant-face ))
123
123
" Face for quoted Julia symbols in `julia-ts-mode' , e.g. :foo." )
124
124
125
+ (defface julia-ts-keyword-argument-face
126
+ '((t :inherit font-lock-constant-face ))
127
+ " Face for keyword argument names in `julia-ts-mode' ." )
128
+
125
129
(defface julia-ts-interpolation-expression-face
126
130
'((t :inherit font-lock-constant-face ))
127
- " Face for interpolation expressions in `julia-ts-mode' , e.g. : foo." )
131
+ " Face for interpolation expressions in `julia-ts-mode' , e.g. $ foo." )
128
132
129
133
(defface julia-ts-string-interpolation-face
130
134
'((t :inherit font-lock-constant-face :weight bold ))
131
- " Face for string interpolations in `julia-ts-mode' , e.g. : foo." )
135
+ " Face for string interpolations in `julia-ts-mode' , e.g. \" $ foo\" ." )
132
136
133
137
(defvar julia-ts--keywords
134
138
'(" baremodule" " begin" " catch" " const" " do" " else" " elseif" " end" " export"
@@ -140,7 +144,7 @@ Otherwise, the indentation is:
140
144
(treesit-font-lock-rules
141
145
:language 'julia
142
146
:feature 'assignment
143
- `((assignment (identifier) @font-lock-variable-name-face (_) )
147
+ `((assignment :anchor [ (identifier) (operator)] @font-lock-variable-name-face)
144
148
(assignment
145
149
:anchor
146
150
(field_expression
@@ -156,15 +160,15 @@ Otherwise, the indentation is:
156
160
((let_statement _ @comma :anchor (identifier) @font-lock-variable-name-face)
157
161
(:equal " ," @comma))
158
162
(let_binding :anchor (identifier) @font-lock-variable-name-face)
159
- (global_statement (identifier) @font-lock-variable-name-face))
163
+ (global_statement (identifier) @font-lock-variable-name-face)
164
+ (named_argument (identifier) @julia-ts-keyword-argument-face (operator)))
160
165
161
166
:language 'julia
162
167
:feature 'constant
163
- `((named_argument (identifier) @julia-ts-quoted-symbol-face (operator))
164
- ((identifier) @font-lock-builtin-face
168
+ `(((identifier) @font-lock-constant-face
165
169
(:match
166
- " ^\\ (:? NaN\\ |NaN16\\ |NaN32\\ |NaN64\\ |Inf\\ |Inf16\\ |Inf32\\ |Inf64\\ |nothing\\ |missing\\ |undef\\ )$"
167
- @font-lock-builtin -face)))
170
+ " ^\\ (NaN\\ |NaN16\\ |NaN32\\ |NaN64\\ |Inf\\ |Inf16\\ |Inf32\\ |Inf64\\ |nothing\\ |missing\\ |undef\\ )$"
171
+ @font-lock-constant -face)))
168
172
169
173
:language 'julia
170
174
:feature 'comment
@@ -225,6 +229,11 @@ Otherwise, the indentation is:
225
229
(assignment
226
230
:anchor
227
231
(call_expression [(identifier) (operator)] @font-lock-function-name-face))
232
+ (assignment
233
+ :anchor
234
+ (call_expression
235
+ (parenthesized_expression
236
+ [(identifier) (operator)] @font-lock-function-name-face)))
228
237
(assignment
229
238
:anchor
230
239
(call_expression
@@ -239,7 +248,10 @@ Otherwise, the indentation is:
239
248
(where_expression
240
249
(call_expression
241
250
(field_expression
242
- value: (identifier) " ." (identifier) @font-lock-function-name-face)))))
251
+ value: (identifier) " ." (identifier) @font-lock-function-name-face))))
252
+ (assignment
253
+ :anchor
254
+ (binary_expression _ (operator) @font-lock-function-name-face)))
243
255
244
256
:language 'julia
245
257
:feature 'error
@@ -270,24 +282,24 @@ Otherwise, the indentation is:
270
282
271
283
:language 'julia
272
284
:feature 'operator
273
- `((adjoint_expression " '" @font-lock-type -face)
274
- (let_binding (operator) @font-lock-type -face)
275
- ((for_binding (operator) @font-lock-type -face)
276
- (:match " ^\\ [=∈\\ ]$" @font-lock-type -face))
277
- (arrow_function_expression " ->" @font-lock-type -face)
278
- (operator) @font-lock-type -face
279
- (splat_expression " ..." @font-lock-type -face)
280
- (ternary_expression [" ?" " :" ] @font-lock-type -face)
281
- ([" ." " ::" ] @font-lock-type -face))
285
+ `((adjoint_expression " '" @font-lock-keyword -face)
286
+ (let_binding (operator) @font-lock-keyword -face)
287
+ ((for_binding (operator) @font-lock-keyword -face)
288
+ (:match " ^\\ [=∈\\ ]$" @font-lock-keyword -face))
289
+ (arrow_function_expression " ->" @font-lock-keyword -face)
290
+ (operator) @font-lock-keyword -face
291
+ (splat_expression " ..." @font-lock-keyword -face)
292
+ (ternary_expression [" ?" " :" ] @font-lock-keyword -face)
293
+ ([" ." " ::" ] @font-lock-keyword -face))
282
294
283
295
:language 'julia
284
296
:feature 'interpolation
285
297
:override 'keep
286
298
`((interpolation_expression
287
- " $" @julia-ts-interpolation-expression-face
299
+ " $" @julia-ts-interpolation-expression-face)
300
+ (interpolation_expression
288
301
(identifier) @default)
289
302
(interpolation_expression
290
- " $" @julia-ts-interpolation-expression-face
291
303
(parenthesized_expression
292
304
" (" @julia-ts-interpolation-expression-face
293
305
_ @default
@@ -333,13 +345,7 @@ Otherwise, the indentation is:
333
345
(curly_expression " {" (identifier) @font-lock-type-face))
334
346
(where_expression
335
347
" where"
336
- (curly_expression " {" (binary_expression (identifier) @font-lock-type-face))))
337
-
338
- :language 'julia
339
- :feature 'keyword
340
- :override t
341
- '((((identifier) @font-lock-keyword-face)
342
- (:equal " new" @font-lock-keyword-face))))
348
+ (curly_expression " {" (binary_expression (identifier) @font-lock-type-face)))))
343
349
344
350
" Tree-sitter font-lock settings for `julia-ts-mode' ." )
345
351
0 commit comments