mirror of
https://codeberg.org/ProgramSnail/tree-sitter-lang.git
synced 2025-12-07 07:08:51 +00:00
config file fixes, langexp -> lang, highlighting
This commit is contained in:
parent
1357783074
commit
154fbfb4d4
5 changed files with 113 additions and 6 deletions
10
Cargo.toml
10
Cargo.toml
|
|
@ -1,11 +1,11 @@
|
||||||
[package]
|
[package]
|
||||||
name = "tree-sitter-YOUR-LANGUAGE-NAME"
|
name = "tree-sitter-lang"
|
||||||
description = "YOUR-LANGUAGE-NAME grammar for the tree-sitter parsing library"
|
description = "lang grammar for the tree-sitter parsing library"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
keywords = ["incremental", "parsing", "YOUR-LANGUAGE-NAME"]
|
keywords = ["incremental", "parsing", "lang"]
|
||||||
categories = ["parsing", "text-editors"]
|
categories = ["parsing", "text-editors"]
|
||||||
repository = "https://github.com/tree-sitter/tree-sitter-YOUR-LANGUAGE-NAME"
|
repository = "https://codeberg.org/programsnail/tree-sitter-lang"
|
||||||
edition = "2018"
|
edition = "2023"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
build = "bindings/rust/build.rs"
|
build = "bindings/rust/build.rs"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"target_name": "tree_sitter_YOUR_LANGUAGE_NAME_binding",
|
"target_name": "tree_sitter_lang_binding",
|
||||||
"include_dirs": [
|
"include_dirs": [
|
||||||
"<!(node -e \"require('nan')\")",
|
"<!(node -e \"require('nan')\")",
|
||||||
"src"
|
"src"
|
||||||
|
|
|
||||||
107
queries/highlights.scm
Normal file
107
queries/highlights.scm
Normal file
|
|
@ -0,0 +1,107 @@
|
||||||
|
[
|
||||||
|
"let"
|
||||||
|
"%"
|
||||||
|
"var"
|
||||||
|
"$"
|
||||||
|
] @keyword.storage.type
|
||||||
|
|
||||||
|
[
|
||||||
|
"in"
|
||||||
|
"<-"
|
||||||
|
"ref"
|
||||||
|
"<>"
|
||||||
|
"const"
|
||||||
|
"--"
|
||||||
|
"out"
|
||||||
|
"->"
|
||||||
|
] @keyword.storage.modifier
|
||||||
|
|
||||||
|
[
|
||||||
|
"for"
|
||||||
|
"@"
|
||||||
|
] @keyword.control.repeat
|
||||||
|
|
||||||
|
[
|
||||||
|
"if"
|
||||||
|
"??"
|
||||||
|
"elif"
|
||||||
|
"!!"
|
||||||
|
"else"
|
||||||
|
"!!=>"
|
||||||
|
] @keyword.control.conditional
|
||||||
|
|
||||||
|
[
|
||||||
|
"break"
|
||||||
|
"continue"
|
||||||
|
"return"
|
||||||
|
"bring"
|
||||||
|
] @keyword.control.return
|
||||||
|
|
||||||
|
[
|
||||||
|
"do"
|
||||||
|
"=>"
|
||||||
|
":="
|
||||||
|
"=:"
|
||||||
|
] @keyword.control
|
||||||
|
|
||||||
|
[
|
||||||
|
"import"
|
||||||
|
"::"
|
||||||
|
] @keyword.control.import
|
||||||
|
|
||||||
|
[
|
||||||
|
"->"
|
||||||
|
"<-"
|
||||||
|
"="
|
||||||
|
"|"
|
||||||
|
"&"
|
||||||
|
":"
|
||||||
|
"!"
|
||||||
|
"?"
|
||||||
|
] @punctuation
|
||||||
|
|
||||||
|
[
|
||||||
|
";"
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
(definition_info) @comment.block.documentation
|
||||||
|
(annotation_info) @comment.block.documentation
|
||||||
|
|
||||||
|
(extra) @comment.block
|
||||||
|
|
||||||
|
(placeholder) @variable.language
|
||||||
|
(simple_name_identifier) @variable
|
||||||
|
(simple_type_identifier) @type
|
||||||
|
(typeclass_identifier) @tag ; for better highlighting
|
||||||
|
(argument_name_identifier) @variable.parameter
|
||||||
|
(argument_type_identifier) @type.builtin ; for better highlighting
|
||||||
|
(annotation_identifier) @attribute
|
||||||
|
|
||||||
|
"\\" @type ; for better highlighting
|
||||||
|
|
||||||
|
(operator) @keyword.operator
|
||||||
|
(operator_tail1) @keyword.operator
|
||||||
|
(operator_tail2) @keyword.operator
|
||||||
|
(operator_tail3) @keyword.operator
|
||||||
|
|
||||||
|
(float_literal) @constant.numeric.float
|
||||||
|
(double_literal) @constant.numeric.float
|
||||||
|
(int_literal) @constant.numeric.integer
|
||||||
|
(long_literal) @constant.numeric.integer
|
||||||
|
(index_literal) @constant.numeric.integer
|
||||||
|
(string_literal) @string
|
||||||
|
(unicode_string_literal) @string
|
||||||
|
(char_literal) @constant.char
|
||||||
|
(unicode_literal) @constant.char
|
||||||
|
(bool_literal) @constant.language
|
||||||
|
(unit_literal) @constant.language
|
||||||
|
(null_literal) @constant.language
|
||||||
Loading…
Add table
Add a link
Reference in a new issue