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 /queries/prolog | |
| 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)
Diffstat (limited to 'queries/prolog')
| -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 |
4 files changed, 67 insertions, 0 deletions
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")) |
