Add Prolog tree-sitter grammar (#11611)

pull/13283/head
Max 2025-04-06 16:43:53 +00:00 committed by GitHub
parent d0c5a2044d
commit 1fc19c6d8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 68 additions and 1 deletions

View File

@ -175,7 +175,7 @@
| ponylang | ✓ | ✓ | ✓ | |
| powershell | ✓ | | | |
| prisma | ✓ | ✓ | | `prisma-language-server` |
| prolog | | | | `swipl` |
| prolog | | | | `swipl` |
| protobuf | ✓ | ✓ | ✓ | `buf`, `pb`, `protols` |
| prql | ✓ | | | |
| purescript | ✓ | ✓ | | `purescript-language-server` |

View File

@ -1501,6 +1501,10 @@ comment-token = "%"
block-comment-tokens = { start = "/*", end = "*/" }
language-servers = [ "swipl" ]
[[grammar]]
name = "prolog"
source = { git = "https://codeberg.org/foxy/tree-sitter-prolog", subpath = "grammars/prolog", rev = "d8d415f6a1cf80ca138524bcc395810b176d40fa" }
[[language]]
name = "tsq"
scope = "source.tsq"

View File

@ -0,0 +1,6 @@
[
(directive_term)
(clause_term)
(arg_list)
(list_notation)
] @fold

View File

@ -0,0 +1,43 @@
(comment) @comment
(atom) @constant
((atom) @constant.builtin.boolean
(#any-of? @constant.builtin.boolean "true" "false"))
(functional_notation
function: (atom) @function)
(integer) @constant.numeric.integer
(float_number) @constant.numeric.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

View File

@ -0,0 +1,12 @@
(functional_notation
(atom)
(open_ct) @indent
(close) @outdent)
(list_notation
(open_list) @indent
(close_list) @outdent)
(curly_bracketed_notation
(open_curly) @indent
(close_curly) @outdent)

View File

@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))