diff options
| author | Stefano Volpe <foxy@teapot.ovh> | 2024-07-02 14:57:30 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-02 16:57:30 +0200 |
| commit | 6cd4ce6cab184e8787f164a182954534221f2af2 (patch) | |
| tree | 38d514949cf80ac96d6a29a7fd0779d3cae7a56e | |
| parent | feat(diff): Highlight comments (diff) | |
| download | nvim-treesitter-6cd4ce6cab184e8787f164a182954534221f2af2.tar nvim-treesitter-6cd4ce6cab184e8787f164a182954534221f2af2.tar.gz nvim-treesitter-6cd4ce6cab184e8787f164a182954534221f2af2.tar.bz2 nvim-treesitter-6cd4ce6cab184e8787f164a182954534221f2af2.tar.lz nvim-treesitter-6cd4ce6cab184e8787f164a182954534221f2af2.tar.xz nvim-treesitter-6cd4ce6cab184e8787f164a182954534221f2af2.tar.zst nvim-treesitter-6cd4ce6cab184e8787f164a182954534221f2af2.zip | |
feat: add prolog and problog parser and queries (#6810)
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | lockfile.json | 6 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 18 | ||||
| -rw-r--r-- | queries/problog/folds.scm | 1 | ||||
| -rw-r--r-- | queries/problog/highlights.scm | 4 | ||||
| -rw-r--r-- | queries/problog/indents.scm | 1 | ||||
| -rw-r--r-- | queries/problog/injections.scm | 1 | ||||
| -rw-r--r-- | queries/prolog/folds.scm | 6 | ||||
| -rw-r--r-- | queries/prolog/highlights.scm | 43 | ||||
| -rw-r--r-- | queries/prolog/indents.scm | 16 | ||||
| -rw-r--r-- | queries/prolog/injections.scm | 2 |
11 files changed, 100 insertions, 0 deletions
@@ -350,6 +350,8 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [pony](https://github.com/amaanq/tree-sitter-pony) (maintained by @amaanq, @mfelsche) - [x] [printf](https://github.com/ObserverOfTime/tree-sitter-printf) (maintained by @ObserverOfTime) - [x] [prisma](https://github.com/victorhqc/tree-sitter-prisma) (maintained by @elianiva) +- [x] [problog](https://codeberg.org/foxy/tree-sitter-prolog) (maintained by @foxyseta) +- [x] [prolog](https://codeberg.org/foxy/tree-sitter-prolog) (maintained by @foxyseta) - [x] [promql](https://github.com/MichaHoffmann/tree-sitter-promql) (maintained by @MichaHoffmann) - [x] [properties](https://github.com/tree-sitter-grammars/tree-sitter-properties) (maintained by @ObserverOfTime) - [x] [proto](https://github.com/treywood/tree-sitter-proto) (maintained by @treywood) diff --git a/lockfile.json b/lockfile.json index 7a4276583..4e1048953 100644 --- a/lockfile.json +++ b/lockfile.json @@ -530,6 +530,12 @@ "prisma": { "revision": "eca2596a355b1a9952b4f80f8f9caed300a272b5" }, + "problog": { + "revision": "d8bc22c007825d3af3d62b4326f9d8f9ca529974" + }, + "prolog": { + "revision": "d8bc22c007825d3af3d62b4326f9d8f9ca529974" + }, "promql": { "revision": "77625d78eebc3ffc44d114a07b2f348dff3061b0" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 4d655727b..8a783483c 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1565,6 +1565,24 @@ list.prisma = { maintainers = { "@elianiva" }, } +list.problog = { + install_info = { + url = "https://codeberg.org/foxy/tree-sitter-prolog", + files = { "src/parser.c" }, + location = "grammars/problog", + }, + maintainers = { "@foxyseta" }, +} + +list.prolog = { + install_info = { + url = "https://codeberg.org/foxy/tree-sitter-prolog", + files = { "src/parser.c" }, + location = "grammars/prolog", + }, + maintainers = { "@foxyseta" }, +} + list.promql = { install_info = { url = "https://github.com/MichaHoffmann/tree-sitter-promql", diff --git a/queries/problog/folds.scm b/queries/problog/folds.scm new file mode 100644 index 000000000..768718207 --- /dev/null +++ b/queries/problog/folds.scm @@ -0,0 +1 @@ +; inherits: prolog diff --git a/queries/problog/highlights.scm b/queries/problog/highlights.scm new file mode 100644 index 000000000..de1715662 --- /dev/null +++ b/queries/problog/highlights.scm @@ -0,0 +1,4 @@ +; inherits: prolog + +(probability_label + _ @attribute) diff --git a/queries/problog/indents.scm b/queries/problog/indents.scm new file mode 100644 index 000000000..768718207 --- /dev/null +++ b/queries/problog/indents.scm @@ -0,0 +1 @@ +; inherits: prolog diff --git a/queries/problog/injections.scm b/queries/problog/injections.scm new file mode 100644 index 000000000..768718207 --- /dev/null +++ b/queries/problog/injections.scm @@ -0,0 +1 @@ +; inherits: prolog diff --git a/queries/prolog/folds.scm b/queries/prolog/folds.scm new file mode 100644 index 000000000..70a401511 --- /dev/null +++ b/queries/prolog/folds.scm @@ -0,0 +1,6 @@ +[ + (directive_term) + (clause_term) + (arg_list) + (list_notation) +] @fold diff --git a/queries/prolog/highlights.scm b/queries/prolog/highlights.scm new file mode 100644 index 000000000..fc89b6fef --- /dev/null +++ b/queries/prolog/highlights.scm @@ -0,0 +1,43 @@ +(comment) @comment @spell + +(atom) @constant + +((atom) @boolean + (#any-of? @boolean "true" "false")) + +(functional_notation + function: (atom) @function.call) + +(integer) @number + +(float_number) @number.float + +(directive_head) @operator + +(operator_notation + operator: _ @operator) + +[ + (open) + (open_ct) + (close) + (open_list) + "|" + (close_list) + (open_curly) + (close_curly) +] @punctuation.bracket + +[ + (arg_list_separator) + (comma) + (end) + (list_notation_separator) +] @punctuation.delimiter + +(operator_notation + operator: (semicolon) @punctuation.delimiter) + +(double_quoted_list_notation) @string + +(variable_term) @variable diff --git a/queries/prolog/indents.scm b/queries/prolog/indents.scm new file mode 100644 index 000000000..a7f9b0383 --- /dev/null +++ b/queries/prolog/indents.scm @@ -0,0 +1,16 @@ +(directive_term) @indent.zero + +(clause_term) @indent.zero + +(functional_notation + (atom) + (open_ct) @indent.begin + (close) @indent.end) + +(list_notation + (open_list) @indent.begin + (close_list) @indent.end) + +(curly_bracketed_notation + (open_curly) @indent.begin + (close_curly) @indent.end) diff --git a/queries/prolog/injections.scm b/queries/prolog/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/queries/prolog/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) |
