aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/prolog
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-06-12 09:54:30 -0600
committerChristian Clason <c.clason@uni-graz.at>2025-05-12 18:43:40 +0200
commit692b051b09935653befdb8f7ba8afdb640adf17b (patch)
tree167162b6b129ae04f68c5735078521a72917c742 /runtime/queries/prolog
parentfeat(c-family): inherit injections (diff)
downloadnvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'runtime/queries/prolog')
-rw-r--r--runtime/queries/prolog/folds.scm6
-rw-r--r--runtime/queries/prolog/highlights.scm43
-rw-r--r--runtime/queries/prolog/indents.scm16
-rw-r--r--runtime/queries/prolog/injections.scm2
4 files changed, 67 insertions, 0 deletions
diff --git a/runtime/queries/prolog/folds.scm b/runtime/queries/prolog/folds.scm
new file mode 100644
index 000000000..70a401511
--- /dev/null
+++ b/runtime/queries/prolog/folds.scm
@@ -0,0 +1,6 @@
+[
+ (directive_term)
+ (clause_term)
+ (arg_list)
+ (list_notation)
+] @fold
diff --git a/runtime/queries/prolog/highlights.scm b/runtime/queries/prolog/highlights.scm
new file mode 100644
index 000000000..fc89b6fef
--- /dev/null
+++ b/runtime/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/runtime/queries/prolog/indents.scm b/runtime/queries/prolog/indents.scm
new file mode 100644
index 000000000..a7f9b0383
--- /dev/null
+++ b/runtime/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/runtime/queries/prolog/injections.scm b/runtime/queries/prolog/injections.scm
new file mode 100644
index 000000000..2f0e58eb6
--- /dev/null
+++ b/runtime/queries/prolog/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))