aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2024-09-09 09:19:58 -0500
committerChristian Clason <c.clason@uni-graz.at>2024-09-30 23:33:44 +0200
commit1a6fa428b812ad53e942ebaf7603fd8a0540b5f7 (patch)
treeb66f03bd185a54284f88da03d72ae9c1d0bd6357
parentbot(lockfile): update swift, tact, tlaplus, v (diff)
downloadnvim-treesitter-1a6fa428b812ad53e942ebaf7603fd8a0540b5f7.tar
nvim-treesitter-1a6fa428b812ad53e942ebaf7603fd8a0540b5f7.tar.gz
nvim-treesitter-1a6fa428b812ad53e942ebaf7603fd8a0540b5f7.tar.bz2
nvim-treesitter-1a6fa428b812ad53e942ebaf7603fd8a0540b5f7.tar.lz
nvim-treesitter-1a6fa428b812ad53e942ebaf7603fd8a0540b5f7.tar.xz
nvim-treesitter-1a6fa428b812ad53e942ebaf7603fd8a0540b5f7.tar.zst
nvim-treesitter-1a6fa428b812ad53e942ebaf7603fd8a0540b5f7.zip
feat(ziggy): add ziggy parser and queries
[Ziggy](https://github.com/kristoff-it/ziggy) is a data serialization format used in the zine static site generator.
-rw-r--r--lockfile.json3
-rw-r--r--lua/nvim-treesitter/parsers.lua9
-rw-r--r--queries/ziggy/highlights.scm41
-rw-r--r--queries/ziggy/indents.scm10
4 files changed, 63 insertions, 0 deletions
diff --git a/lockfile.json b/lockfile.json
index d24a2616e..5ebfc8c29 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -889,5 +889,8 @@
},
"zig": {
"revision": "eb7d58c2dc4fbeea4745019dee8df013034ae66b"
+ },
+ "ziggy": {
+ "revision": "c66f47bc632c66668d61fa06eda112b41d6e5130"
}
}
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 8bc1f9d9e..6d445dece 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -2564,6 +2564,15 @@ list.zig = {
maintainers = { "@amaanq" },
}
+list.ziggy = {
+ install_info = {
+ url = "https://github.com/kristoff-it/ziggy",
+ files = { "src/parser.c" },
+ location = "tree-sitter-ziggy",
+ },
+ maintainers = { "@rockorager" },
+}
+
list.templ = {
install_info = {
url = "https://github.com/vrischmann/tree-sitter-templ",
diff --git a/queries/ziggy/highlights.scm b/queries/ziggy/highlights.scm
new file mode 100644
index 000000000..27f6c9a48
--- /dev/null
+++ b/queries/ziggy/highlights.scm
@@ -0,0 +1,41 @@
+[
+ (true)
+ (false)
+] @constant.builtin
+
+(null) @constant.builtin
+
+[
+ (integer)
+ (float)
+] @number
+
+(struct_field
+ key: (_) @keyword)
+
+(struct
+ name: (_) @type)
+
+(tag) @function
+
+[
+ (string)
+ (line_string)*
+] @string
+
+(comment) @comment
+
+(escape_sequence) @string.escape
+
+"," @punctuation.delimiter
+
+[
+ "["
+ "]"
+ "{"
+ "}"
+ "("
+ ")"
+] @punctuation.bracket
+
+(top_comment) @comment
diff --git a/queries/ziggy/indents.scm b/queries/ziggy/indents.scm
new file mode 100644
index 000000000..223bde81a
--- /dev/null
+++ b/queries/ziggy/indents.scm
@@ -0,0 +1,10 @@
+[
+ (struct)
+ (map)
+ (array)
+] @indent.begin
+
+[
+ "]"
+ "}"
+] @indent.end