Add keywords highlighting

This commit is contained in:
Bruno BELANYI 2022-06-02 22:27:42 +02:00
parent 751929a058
commit d83fa3acb7
2 changed files with 64 additions and 0 deletions

View file

@ -1,5 +1,28 @@
(comment) @comment
; Keywords {{{
[
"array"
(break_expression)
"do"
"else"
"end"
"for"
"function"
"if"
"import"
"in"
"let"
"of"
"primitive"
"then"
"to"
"type"
"var"
"while"
] @keyword
; }}}
; Literals {{{
(nil_literal) @constant.builtin
(integer_literal) @number

View file

@ -0,0 +1,41 @@
let
/* <- keyword */
var a := 12
/* <- keyword */
function f() : int = a
/* <- keyword */
primitive g()
/* <- keyword */
import "lib.tih"
/* <- keyword */
type array_of_int = array of int
/* <- keyword */
/* ^ keyword */
/* ^ keyword */
in
/* <- keyword */
12;
if 12 then 27 else 42;
/* <- keyword */
/* ^ keyword */
/* ^ keyword */
for i := 12 to 27 do 42;
/* <- keyword */
/* ^ keyword */
/* ^ keyword */
while 12 do break
/* <- keyword */
/* ^ keyword */
/* ^ keyword */
end
/* <- keyword */