Add 'self' built-in variable high-lighting
This commit is contained in:
parent
acb5765591
commit
b1c2da4cb4
|
@ -7,6 +7,10 @@
|
||||||
((type_identifier) @type.builtin
|
((type_identifier) @type.builtin
|
||||||
(#match? @type.builtin "^(int|string|Object)$")
|
(#match? @type.builtin "^(int|string|Object)$")
|
||||||
(#is-not? local))
|
(#is-not? local))
|
||||||
|
|
||||||
|
((identifier) @variable.builtin
|
||||||
|
(#match? @variable.builtin "^self$")
|
||||||
|
(#is-not? local))
|
||||||
; }}}
|
; }}}
|
||||||
|
|
||||||
; Keywords {{{
|
; Keywords {{{
|
||||||
|
|
|
@ -18,6 +18,8 @@ let
|
||||||
/* ^ type.builtin */
|
/* ^ type.builtin */
|
||||||
|
|
||||||
type Object = int
|
type Object = int
|
||||||
|
|
||||||
|
var self := "self"
|
||||||
in
|
in
|
||||||
let
|
let
|
||||||
var c : int := "This is an int"
|
var c : int := "This is an int"
|
||||||
|
@ -33,6 +35,9 @@ in
|
||||||
print("shadowing is fun");
|
print("shadowing is fun");
|
||||||
/* <- function.builtin */
|
/* <- function.builtin */
|
||||||
|
|
||||||
|
self;
|
||||||
|
/* <- variable */
|
||||||
|
|
||||||
b := print
|
b := print
|
||||||
/* ^ variable */
|
/* ^ variable */
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,7 @@ let
|
||||||
method meth() : int = self.a
|
method meth() : int = self.a
|
||||||
/* <- keyword.method */
|
/* <- keyword.method */
|
||||||
/* ^ method */
|
/* ^ method */
|
||||||
/* ^ variable */
|
/* ^ variable.builtin */
|
||||||
}
|
}
|
||||||
|
|
||||||
var object := new B
|
var object := new B
|
||||||
|
|
Loading…
Reference in a new issue