mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 20:00:07 -04:00
Added highlights.scm and tests.mzn
This commit is contained in:
parent
30d2648f94
commit
ee8c109cbd
2 changed files with 138 additions and 0 deletions
125
runtime/queries/minizinc/highlights.scm
Normal file
125
runtime/queries/minizinc/highlights.scm
Normal file
|
|
@ -0,0 +1,125 @@
|
||||||
|
; Function calls
|
||||||
|
(call
|
||||||
|
function: (identifier) @function)
|
||||||
|
|
||||||
|
; Function definitions
|
||||||
|
(function_item
|
||||||
|
name: (identifier) @function)
|
||||||
|
|
||||||
|
(predicate
|
||||||
|
name: (identifier) @function)
|
||||||
|
|
||||||
|
; Types
|
||||||
|
(primitive_type) @type.builtin
|
||||||
|
|
||||||
|
[
|
||||||
|
"array"
|
||||||
|
"of"
|
||||||
|
"par"
|
||||||
|
"set"
|
||||||
|
"var"
|
||||||
|
] @type.builtin
|
||||||
|
|
||||||
|
; Identifiers
|
||||||
|
(identifier) @variable
|
||||||
|
|
||||||
|
; Keywords
|
||||||
|
[
|
||||||
|
"annotation"
|
||||||
|
"constraint"
|
||||||
|
"else"
|
||||||
|
"elseif"
|
||||||
|
"endif"
|
||||||
|
"enum"
|
||||||
|
"function"
|
||||||
|
"if"
|
||||||
|
"include"
|
||||||
|
"let"
|
||||||
|
"maximize"
|
||||||
|
"minimize"
|
||||||
|
"output"
|
||||||
|
"predicate"
|
||||||
|
"satisfy"
|
||||||
|
"solve"
|
||||||
|
"test"
|
||||||
|
"then"
|
||||||
|
"where"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
; Operators
|
||||||
|
[
|
||||||
|
"<->"
|
||||||
|
"->"
|
||||||
|
"<-"
|
||||||
|
"\\/"
|
||||||
|
"xor"
|
||||||
|
"/\\"
|
||||||
|
"="
|
||||||
|
"=="
|
||||||
|
"!="
|
||||||
|
"<"
|
||||||
|
"<="
|
||||||
|
">"
|
||||||
|
">="
|
||||||
|
"in"
|
||||||
|
"subset"
|
||||||
|
"superset"
|
||||||
|
"union"
|
||||||
|
"diff"
|
||||||
|
"symdiff"
|
||||||
|
"intersect"
|
||||||
|
".."
|
||||||
|
"+"
|
||||||
|
"-"
|
||||||
|
"++"
|
||||||
|
"*"
|
||||||
|
"/"
|
||||||
|
"div"
|
||||||
|
"mod"
|
||||||
|
"^"
|
||||||
|
"::"
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
; Punctuation
|
||||||
|
[
|
||||||
|
","
|
||||||
|
":"
|
||||||
|
";"
|
||||||
|
"|"
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
; Literals
|
||||||
|
[
|
||||||
|
(integer_literal)
|
||||||
|
(float_literal)
|
||||||
|
] @number
|
||||||
|
|
||||||
|
[
|
||||||
|
(string_literal)
|
||||||
|
(string_interpolation)
|
||||||
|
] @string
|
||||||
|
|
||||||
|
[
|
||||||
|
(escape_sequence)
|
||||||
|
(escape_interpolation)
|
||||||
|
] @string.escape
|
||||||
|
|
||||||
|
[
|
||||||
|
(absent)
|
||||||
|
(boolean_literal)
|
||||||
|
] @constant.builtin
|
||||||
|
|
||||||
|
; Comments
|
||||||
|
[
|
||||||
|
(block_comment)
|
||||||
|
(line_comment)
|
||||||
|
] @comment
|
||||||
13
tests/query/highlights/minizinc/test.mzn
Normal file
13
tests/query/highlights/minizinc/test.mzn
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
% include "data.dzn";
|
||||||
|
% ^^^^^^^ @keyword.directive
|
||||||
|
% ^^^^^^^^^^ @string
|
||||||
|
% ^ @punctuation.delimiter
|
||||||
|
|
||||||
|
var 1..10: x;
|
||||||
|
% ^^^ @keyword
|
||||||
|
% ^ @number
|
||||||
|
% ^^ @operator
|
||||||
|
% ^^ @number
|
||||||
|
% ^ @punctuation.delimiter
|
||||||
|
% ^ @variable
|
||||||
|
% ^ @punctuation.delimiter
|
||||||
Loading…
Add table
Add a link
Reference in a new issue