summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAddison Chan <addison95132@gmail.com>2022-03-14 10:01:14 -0700
committerStephan Seitz <stephan.seitz@fau.de>2022-03-17 08:40:34 +0100
commit2dfe7a5839fe508f50929f33ab948d8485e3f5a9 (patch)
treedfa3a635075bdecc365cf04aedb6a3821006db67
parentc993f27469627292ed47b19e2960caa184cd4624 (diff)
Add Cooklang
-rw-r--r--ftdetect/cooklang.vim1
-rw-r--r--lua/nvim-treesitter/parsers.lua9
-rw-r--r--queries/cooklang/highlights.scm22
3 files changed, 32 insertions, 0 deletions
diff --git a/ftdetect/cooklang.vim b/ftdetect/cooklang.vim
new file mode 100644
index 00000000..4f165b94
--- /dev/null
+++ b/ftdetect/cooklang.vim
@@ -0,0 +1 @@
+autocmd BufRead,BufNewFile *.cook set filetype=cooklang
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 88bf364a..5d6c8f75 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -968,6 +968,15 @@ list.solidity = {
maintainers = { "@YongJieYongJie" },
}
+list.cooklang = {
+ install_info = {
+ url = "https://github.com/addcninblue/tree-sitter-cooklang",
+ branch = "master",
+ files = { "src/parser.c", "src/scanner.cc" },
+ },
+ maintainers = { "@addcninblue" },
+}
+
local M = {
list = list,
filetype_to_parsername = filetype_to_parsername,
diff --git a/queries/cooklang/highlights.scm b/queries/cooklang/highlights.scm
new file mode 100644
index 00000000..4ced465b
--- /dev/null
+++ b/queries/cooklang/highlights.scm
@@ -0,0 +1,22 @@
+(metadata) @comment
+
+(ingredient
+ "@" @tag
+ (name)? @text.title
+ (amount
+ (quantity)? @number
+ (units)? @tag.attribute)?)
+
+(timer
+ "~" @tag
+ (name)? @text.title
+ (amount
+ (quantity)? @number
+ (units)? @tag.attribute)?)
+
+(cookware
+ "#" @tag
+ (name)? @text.title
+ (amount
+ (quantity)? @number
+ (units)? @tag.attribute)?)