nvim-treesitter/tests/query/highlights/tiger/built-ins.tig

45 lines
932 B
Text
Raw Normal View History

2022-06-14 17:30:49 +02:00
let
var a := exit(0)
2023-12-24 12:52:21 +01:00
/* ^ @function.builtin */
2022-06-14 17:30:49 +02:00
primitive exit(ret: int) /* Shadowing the prelude-included built-in */
2023-12-24 12:52:21 +01:00
/* ^ @type.builtin */
2022-06-14 17:30:49 +02:00
var b := exit(0)
2023-12-24 12:52:21 +01:00
/* ^ @function.builtin */
2022-06-14 17:30:49 +02:00
type int = string /* Shadowing the built-in type */
2023-12-24 12:52:21 +01:00
/* ^ @type.builtin */
2022-06-14 17:30:49 +02:00
var c : int := "This is an \"int\""
2023-12-24 12:52:21 +01:00
/* ^ @type.builtin (not sure why it isn't 'type')*/
2022-06-14 17:30:49 +02:00
var d : Object := nil
2023-12-24 12:52:21 +01:00
/* ^ @type.builtin */
2022-06-14 17:30:49 +02:00
type Object = int
var self := "self"
in
let
var c : int := "This is an int"
2023-12-24 12:52:21 +01:00
/* ^ @type.builtin (not sure why it isn't 'type')*/
2022-06-14 17:30:49 +02:00
var d : Object := "This is an object"
2023-12-24 12:52:21 +01:00
/* ^ @type.builtin (not sure why it isn't 'type')*/
2022-06-14 17:30:49 +02:00
in
end;
exit(1);
2023-12-24 12:52:21 +01:00
/* <- @function.builtin */
2022-06-14 17:30:49 +02:00
print("shadowing is fun");
2023-12-24 12:52:21 +01:00
/* <- @function.builtin */
2022-06-14 17:30:49 +02:00
self;
2023-12-24 12:52:21 +01:00
/* <- @variable.builtin */
2022-06-14 17:30:49 +02:00
b := print
2023-12-24 12:52:21 +01:00
/* ^ @variable */
2022-06-14 17:30:49 +02:00
end
/* vim: set ft=tiger: */