tree-sitter-tiger/test/highlight/built-ins.tig

44 lines
871 B
Plaintext
Raw Normal View History

let
var a := exit(0)
/* ^ function.builtin */
primitive exit(ret: int) /* Shadowing the prelude-included built-in */
/* ^ type.builtin */
var b := exit(0)
/* ^ function */
type int = string /* Shadowing the built-in type */
/* ^ type.builtin */
var c : int := "This is an \"int\""
/* ^ type.builtin (not sure why it isn't 'type')*/
2022-06-04 21:31:43 +02:00
var d : Object := nil
/* ^ type.builtin */
type Object = int
var self := "self"
in
let
var c : int := "This is an int"
/* ^ type.builtin (not sure why it isn't 'type')*/
2022-06-04 21:31:43 +02:00
var d : Object := "This is an object"
/* ^ type.builtin (not sure why it isn't 'type')*/
in
end;
exit(1);
/* <- function */
print("shadowing is fun");
/* <- function.builtin */
self;
/* <- variable */
b := print
/* ^ variable */
end