mirror of
https://github.com/helix-editor/helix.git
synced 2025-10-05 16:03:18 +02:00
add highlighting for nearley (#14482)
This commit is contained in:
@@ -174,6 +174,7 @@
|
||||
| move | ✓ | | | | | |
|
||||
| msbuild | ✓ | | ✓ | | | |
|
||||
| nasm | ✓ | ✓ | | | | `asm-lsp` |
|
||||
| nearley | ✓ | | | | ✓ | |
|
||||
| nestedtext | ✓ | ✓ | ✓ | | | |
|
||||
| nginx | ✓ | | | | | |
|
||||
| nickel | ✓ | | ✓ | | | `nls` |
|
||||
|
@@ -4876,3 +4876,14 @@ indent = { tab-width = 2, unit = " " }
|
||||
[[grammar]]
|
||||
name = "slisp"
|
||||
source = { git = "https://github.com/xenogenics/tree-sitter-slisp", rev = "29f9c6707ce9dfc2fc915d175ec720b207f179f3" }
|
||||
|
||||
[[language]]
|
||||
name = "nearley"
|
||||
scope = "source.nearley"
|
||||
file-types = ["ne"]
|
||||
comment-token = "#"
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
|
||||
[[grammar]]
|
||||
name = "nearley"
|
||||
source = { git = "https://github.com/mi2ebi/tree-sitter-nearley", rev = "12d01113e194c8e83f6341aab8c2a5f21db9cac9" }
|
||||
|
43
runtime/queries/nearley/highlights.scm
Normal file
43
runtime/queries/nearley/highlights.scm
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
(comment) @comment.line
|
||||
|
||||
(string) @string
|
||||
(string "i" @keyword.modifier)
|
||||
|
||||
(identifier) @variable.other
|
||||
(rule_name (identifier) @function)
|
||||
(rule (generic (identifier) @function))
|
||||
|
||||
(directive_name) @keyword.directive
|
||||
(directive_value (identifier) @constant)
|
||||
(directive_value (string) @string)
|
||||
|
||||
(token) @constant
|
||||
|
||||
(generic
|
||||
"<" @punctuation.bracket
|
||||
(identifier) @type.parameter
|
||||
">" @punctuation.bracket
|
||||
)
|
||||
|
||||
(group "(" @punctuation.bracket ")" @punctuation.bracket)
|
||||
|
||||
(charset) @string.regexp
|
||||
(wildcard) @keyword
|
||||
|
||||
(quantifier) @function.builtin
|
||||
|
||||
(macro_name
|
||||
"[" @punctuation.bracket
|
||||
(identifier) @variable.parameter
|
||||
"]" @punctuation.bracket
|
||||
)
|
||||
(macro_arg) @variable.parameter
|
||||
|
||||
(rule "->" @operator)
|
||||
(rule_body "|" @operator)
|
||||
|
||||
(cont_block "@{%" @keyword.directive "%}" @keyword.directive)
|
||||
(cont_inline "{%" @keyword.directive "%}" @keyword.directive)
|
||||
|
||||
(ifdef) @keyword.directive
|
2
runtime/queries/nearley/injections.scm
Normal file
2
runtime/queries/nearley/injections.scm
Normal file
@@ -0,0 +1,2 @@
|
||||
((cont) @injection.content
|
||||
(#set! injection.language "javascript"))
|
3
runtime/queries/nearley/rainbows.scm
Normal file
3
runtime/queries/nearley/rainbows.scm
Normal file
@@ -0,0 +1,3 @@
|
||||
((group) @rainbow.scope)
|
||||
|
||||
["(" ")"] @rainbow.bracket
|
Reference in New Issue
Block a user