feat: add RON

This commit is contained in:
Amaan Qureshi 2023-02-04 15:42:12 -05:00 committed by Stephan Seitz
parent 70af55b428
commit 720f75f988
8 changed files with 100 additions and 2 deletions

7
queries/ron/folds.scm Normal file
View file

@ -0,0 +1,7 @@
[
(array)
(map)
(tuple)
(struct)
(block_comment)
] @fold

View file

@ -0,0 +1,53 @@
; Structs
;------------
(enum_variant) @constant
(struct_entry (identifier) @property)
(struct_entry (enum_variant (identifier) @constant))
(struct_name (identifier)) @type
(unit_struct) @type.builtin
; Literals
;------------
(string) @string
(boolean) @boolean
(integer) @number
(float) @float
(char) @character
; Comments
;------------
[
(line_comment)
(block_comment)
] @comment @spell
; Punctuation
;------------
["{" "}"] @punctuation.bracket
["(" ")"] @punctuation.bracket
["[" "]"] @punctuation.bracket
[
","
":"
] @punctuation.delimiter
[
"-"
] @operator
; Special
;------------
(escape_sequence) @string.escape
(ERROR) @error

12
queries/ron/indents.scm Normal file
View file

@ -0,0 +1,12 @@
[
(array)
(map)
(tuple)
(struct)
] @indent
[ "{" "}" ] @branch
[ "(" ")" ] @branch
[ "[" "]" ] @branch

View file

@ -0,0 +1,4 @@
[
(line_comment)
(block_comment)
] @comment

12
queries/ron/locals.scm Normal file
View file

@ -0,0 +1,12 @@
(source_file) @scope
(source_file (array) @scope)
(source_file (map) @scope)
(source_file (struct) @scope)
(source_file (tuple) @scope)
(identifier) @reference
(struct_entry (identifier) @definition.field)
(struct_entry (identifier) @definition.enum (enum_variant))
(struct (struct_name) @definition.type)