Skip to content

Commit

Permalink
switch to tree-sitter-ron
Browse files Browse the repository at this point in the history
  • Loading branch information
gabydd committed Oct 26, 2023
1 parent f6021dd commit 00e4d3e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 4 deletions.
6 changes: 5 additions & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,11 @@ file-types = ["ron"]
roots = []
comment-token = "//"
indent = { tab-width = 4, unit = " " }
grammar = "rust"
grammar = "ron"

[[grammar]]
name = "ron"
source = { git = "https://github.com/zee-editor/tree-sitter-ron", rev = "7762d709a0f7c1f9e269d0125a2e8a7a69006146" }

[[language]]
name = "robot"
Expand Down
45 changes: 44 additions & 1 deletion runtime/queries/ron/highlights.scm
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
; inherits: rust
; Literals
;------------

(string) @string
(boolean) @constant.builtin.boolean
(integer) @constant.numeric.integer
(float) @constant.numeric.float
(char) @constant.character

; Structs
;------------

(enum_variant) @type.enum.variant
(struct_entry (_) @variable.other.member ":")
(struct_name (identifier)) @type




; Comments
;------------

(line_comment) @comment.line
(block_comment) @comment.block


; Punctuation
;------------

"," @punctuation.delimiter
":" @punctuation.delimiter

"(" @punctuation.bracket
")" @punctuation.bracket
"[" @punctuation.bracket
"]" @punctuation.bracket
"{" @punctuation.bracket
"}" @punctuation.bracket


; Special
;------------
(escape_sequence) @constant.character.escape
(ERROR) @error
13 changes: 12 additions & 1 deletion runtime/queries/ron/indents.scm
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
; inherits: rust
[
(array)
(map)
(tuple)
(struct)
] @indent

[
"}"
"]"
")"
] @outdent
3 changes: 2 additions & 1 deletion runtime/queries/ron/injections.scm
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
; inherits: rust
([(line_comment) (block_comment)] @injection.content
(#set! injection.language "comment"))

0 comments on commit 00e4d3e

Please sign in to comment.