feat: add prolog and problog parser and queries (#6810)

This commit is contained in:
Stefano Volpe 2024-07-02 14:57:30 +00:00 committed by GitHub
parent e0d6c7643d
commit 6cd4ce6cab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 100 additions and 0 deletions

View file

@ -0,0 +1 @@
; inherits: prolog

View file

@ -0,0 +1,4 @@
; inherits: prolog
(probability_label
_ @attribute)

View file

@ -0,0 +1 @@
; inherits: prolog

View file

@ -0,0 +1 @@
; inherits: prolog

6
queries/prolog/folds.scm Normal file
View file

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

View file

@ -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

View file

@ -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)

View file

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