Add 'self' built-in variable high-lighting
This commit is contained in:
parent
acb5765591
commit
b1c2da4cb4
|
@ -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 {{{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -14,7 +14,7 @@ let
|
|||
method meth() : int = self.a
|
||||
/* <- keyword.method */
|
||||
/* ^ method */
|
||||
/* ^ variable */
|
||||
/* ^ variable.builtin */
|
||||
}
|
||||
|
||||
var object := new B
|
||||
|
|
Loading…
Reference in a new issue