Add 'self' built-in variable high-lighting

This commit is contained in:
Bruno BELANYI 2022-06-04 21:38:21 +02:00
parent acb5765591
commit b1c2da4cb4
3 changed files with 10 additions and 1 deletions

View file

@ -7,6 +7,10 @@
((type_identifier) @type.builtin
(#match? @type.builtin "^(int|string|Object)$")
(#is-not? local))
((identifier) @variable.builtin
(#match? @variable.builtin "^self$")
(#is-not? local))
; }}}
; Keywords {{{

View file

@ -18,6 +18,8 @@ let
/* ^ type.builtin */
type Object = int
var self := "self"
in
let
var c : int := "This is an int"
@ -33,6 +35,9 @@ in
print("shadowing is fun");
/* <- function.builtin */
self;
/* <- variable */
b := print
/* ^ variable */
end

View file

@ -14,7 +14,7 @@ let
method meth() : int = self.a
/* <- keyword.method */
/* ^ method */
/* ^ variable */
/* ^ variable.builtin */
}
var object := new B