Add initial highlights.scm for syntax highlighting
This commit is contained in:
parent
6dd0013ce1
commit
2088b17243
10
package.json
10
package.json
@ -27,5 +27,15 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prettier": "2.2.1",
|
"prettier": "2.2.1",
|
||||||
"tree-sitter-cli": "^0.16.9"
|
"tree-sitter-cli": "^0.16.9"
|
||||||
|
},
|
||||||
|
"tree-sitter": [
|
||||||
|
{
|
||||||
|
"scope": "source.minizinc",
|
||||||
|
"file-types": [
|
||||||
|
"mzn",
|
||||||
|
"fzn",
|
||||||
|
"dzn"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
114
queries/highlights.scm
Normal file
114
queries/highlights.scm
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
; Function calls
|
||||||
|
(call name: (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"
|
||||||
|
"function"
|
||||||
|
"if"
|
||||||
|
"in"
|
||||||
|
"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
|
||||||
|
|
||||||
|
[
|
||||||
|
(absent)
|
||||||
|
(boolean_literal)
|
||||||
|
] @constant.builtin
|
||||||
|
|
||||||
|
; Comments
|
||||||
|
[
|
||||||
|
(block_comment)
|
||||||
|
(line_comment)
|
||||||
|
] @comment
|
Reference in New Issue
Block a user