add highlighting for nearley (#14482)

This commit is contained in:
evie
2025-10-04 12:22:28 -07:00
committed by GitHub
parent 81b4a2c9d8
commit 6fffaf6a7d
5 changed files with 60 additions and 0 deletions

View File

@@ -174,6 +174,7 @@
| move | ✓ | | | | | |
| msbuild | ✓ | | ✓ | | | |
| nasm | ✓ | ✓ | | | | `asm-lsp` |
| nearley | ✓ | | | | ✓ | |
| nestedtext | ✓ | ✓ | ✓ | | | |
| nginx | ✓ | | | | | |
| nickel | ✓ | | ✓ | | | `nls` |

View File

@@ -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" }

View 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

View File

@@ -0,0 +1,2 @@
((cont) @injection.content
(#set! injection.language "javascript"))

View File

@@ -0,0 +1,3 @@
((group) @rainbow.scope)
["(" ")"] @rainbow.bracket