Skip to content

Commit

Permalink
add new highlights (#17)
Browse files Browse the repository at this point in the history
* add new highlights

* more highlights

* @variable.parameter to @parameter

* add ERROR highlight
  • Loading branch information
aspeddro committed Nov 15, 2021
1 parent ed9d2ec commit 82c8d71
Showing 1 changed file with 48 additions and 15 deletions.
63 changes: 48 additions & 15 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
; highlights.scm

(call function: (identifier) @function)
(namespace_get function: (identifier) @function.method)
(namespace_get_internal function: (identifier) @function.method)
(call arguments:
(arguments
name: (identifier) @parameter ))

(lambda_function "\\" @operator)

(namespace_get function: (identifier) @method)
(namespace_get_internal function: (identifier) @method)

(namespace_get namespace: (identifier) @namespace
"::" @operator)
(namespace_get_internal namespace: (identifier) @namespace
":::" @operator)

; Literals

(integer) @number

(float) @number
(float) @float

(complex) @number

(string) @string

(comment) @comment

(formal_parameters (identifier) @variable.parameter)
(formal_parameters (identifier) @parameter)

(identifier) @variable

Expand Down Expand Up @@ -67,21 +78,43 @@
"}"
] @punctuation.bracket

(dollar "$" @operator)

(subset2
"[[" @punctuation.bracket
"]]" @punctuation.bracket)

[
"while"
"if"
"else"
"function"
"repeat"
"for"
"in"
(dots)
(true)
(false)
(break)
(next)
(inf)
(nan)
(na)
(null)
] @keyword

[
(nan)
(na)
(null)
] @type.builtin

[
"if"
"else"
] @conditional

[
"while"
"repeat"
"for"
] @repeat

[
(true)
(false)
] @boolean

"function" @keyword.function

; Error
(ERROR) @error

0 comments on commit 82c8d71

Please sign in to comment.