From 4e35ae6f71f5b734ffd876cf8661630cea3a26ae Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Thu, 10 Aug 2023 11:35:27 +0300 Subject: feat: add pymanifest parser --- README.md | 1 + lockfile.json | 3 +++ lua/nvim-treesitter/parsers.lua | 9 +++++++++ queries/pymanifest/highlights.scm | 22 ++++++++++++++++++++++ queries/pymanifest/injections.scm | 2 ++ 5 files changed, 37 insertions(+) create mode 100644 queries/pymanifest/highlights.scm create mode 100644 queries/pymanifest/injections.scm diff --git a/README.md b/README.md index 5a7cae35a..88ee4d3f1 100644 --- a/README.md +++ b/README.md @@ -311,6 +311,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [prql](https://github.com/PRQL/tree-sitter-prql) (maintained by @matthias-Q) - [x] [pug](https://github.com/zealot128/tree-sitter-pug) (experimental, maintained by @zealot128) - [x] [puppet](https://github.com/amaanq/tree-sitter-puppet) (maintained by @amaanq) +- [x] [PyPA manifest](https://github.com/ObserverOfTime/tree-sitter-pymanifest) (maintained by @ObserverOfTime) - [x] [python](https://github.com/tree-sitter/tree-sitter-python) (maintained by @stsewd, @theHamsta) - [x] [ql](https://github.com/tree-sitter/tree-sitter-ql) (maintained by @pwntester) - [x] [qmldir](https://github.com/Decodetalkers/tree-sitter-qmldir) (maintained by @amaanq) diff --git a/lockfile.json b/lockfile.json index 3a15ebf32..941ac0f1a 100644 --- a/lockfile.json +++ b/lockfile.json @@ -413,6 +413,9 @@ "puppet": { "revision": "9ce9a5f7d64528572aaa8d59459ba869e634086b" }, + "pymanifest": { + "revision": "8953f91d733dd92c1ac43b3d58a7a2f43fa62dae" + }, "python": { "revision": "5af00f64af6bbf822f208243cce5cf75396fb6f5" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 08817b5df..6bb88ac06 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1241,6 +1241,15 @@ list.puppet = { maintainers = { "@amaanq" }, } +list.pymanifest = { + install_info = { + url = "https://github.com/ObserverOfTime/tree-sitter-pymanifest", + files = { "src/parser.c" }, + }, + maintainers = { "@ObserverOfTime" }, + readme_name = "PyPA manifest", +} + list.python = { install_info = { url = "https://github.com/tree-sitter/tree-sitter-python", diff --git a/queries/pymanifest/highlights.scm b/queries/pymanifest/highlights.scm new file mode 100644 index 000000000..f2522443e --- /dev/null +++ b/queries/pymanifest/highlights.scm @@ -0,0 +1,22 @@ +(keyword) @keyword + +(dir_sep) @punctuation.delimiter + +(glob) @punctuation.special + +(linebreak) @character.special + +(char_sequence) @string.special + +(char_sequence + [ "[" "]" ] @punctuation.bracket) + +(char_sequence "!" @operator) + +(char_range "-" @operator) + +(escaped_char) @string.escape + +(ERROR) @error + +(comment) @comment diff --git a/queries/pymanifest/injections.scm b/queries/pymanifest/injections.scm new file mode 100644 index 000000000..321c90add --- /dev/null +++ b/queries/pymanifest/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) -- cgit v1.2.3-70-g09d2