Skip to content

Commit

Permalink
feat: highlighting queries
Browse files Browse the repository at this point in the history
  • Loading branch information
viddrobnic committed Jul 7, 2024
1 parent 9b01852 commit ea7993b
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions tree-sitter-aoc/queries/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
(comment) @comment @spell

(identifier) @variable

"fn" @keyword.function
"use" @keyword.import
["for" "while"] @keyword.repeat
"return" @keyword.return
["if" "else"] @keyword.conditional


(integer) @number
(float) @number.float
(true) @boolean
(false) @boolean
(null) @constant.builtin
(char) @character
(string) @string @spell
(escape_sequence) @string.escape

(function_literal
(identifier) @variable.parameter)

(function_call
function: (identifier) @function.call)

((identifier) @function.builtin
(#any-of? @function.builtin
"len"
"str"
"int"
"char"
"float"
"bool"
"is_null"
"floor"
"ceil"
"round"
"trim_start"
"trim_end"
"trim"
"split"
"push"
"pop"
"del"
"print"
"input"
))

(dot_index
index: (identifier) @property)

["," ";" "."] @punctuation.delimiter
["(" ")" "{" "}" "[" "]"] @punctuation.bracket
[
"="
"=="
"<"
">"
"<="
">="
"!"
"-"
"+"
"*"
"/"
"%"
"&"
"|"
"!="
] @operator

0 comments on commit ea7993b

Please sign in to comment.