From 2dfe7a5839fe508f50929f33ab948d8485e3f5a9 Mon Sep 17 00:00:00 2001 From: Addison Chan Date: Mon, 14 Mar 2022 10:01:14 -0700 Subject: Add Cooklang --- ftdetect/cooklang.vim | 1 + lua/nvim-treesitter/parsers.lua | 9 +++++++++ queries/cooklang/highlights.scm | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 ftdetect/cooklang.vim create mode 100644 queries/cooklang/highlights.scm diff --git a/ftdetect/cooklang.vim b/ftdetect/cooklang.vim new file mode 100644 index 000000000..4f165b94f --- /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 88bf364a4..5d6c8f75c 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 000000000..4ced465bd --- /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)?) -- cgit v1.2.3-70-g09d2