chore(tests): consistent captures

This commit is contained in:
Christian Clason 2023-12-24 12:52:21 +01:00
parent 17fae3f4a3
commit 10dd49958c
60 changed files with 872 additions and 873 deletions

View file

@ -1,21 +1,21 @@
let
var a := exit(0)
/* ^ function.builtin */
/* ^ @function.builtin */
primitive exit(ret: int) /* Shadowing the prelude-included built-in */
/* ^ type.builtin */
/* ^ @type.builtin */
var b := exit(0)
/* ^ function.builtin */
/* ^ @function.builtin */
type int = string /* Shadowing the built-in type */
/* ^ type.builtin */
/* ^ @type.builtin */
var c : int := "This is an \"int\""
/* ^ type.builtin (not sure why it isn't 'type')*/
/* ^ @type.builtin (not sure why it isn't 'type')*/
var d : Object := nil
/* ^ type.builtin */
/* ^ @type.builtin */
type Object = int
@ -23,22 +23,22 @@ let
in
let
var c : int := "This is an int"
/* ^ type.builtin (not sure why it isn't 'type')*/
/* ^ @type.builtin (not sure why it isn't 'type')*/
var d : Object := "This is an object"
/* ^ type.builtin (not sure why it isn't 'type')*/
/* ^ @type.builtin (not sure why it isn't 'type')*/
in
end;
exit(1);
/* <- function.builtin */
/* <- @function.builtin */
print("shadowing is fun");
/* <- function.builtin */
/* <- @function.builtin */
self;
/* <- variable.builtin */
/* <- @variable.builtin */
b := print
/* ^ variable */
/* ^ @variable */
end
/* vim: set ft=tiger: */

View file

@ -1,6 +1,6 @@
/* This is /* a nested */ comment */
/* <- comment
^ comment
^ comment
/* <- @comment
^ @comment
^ @comment
*/
/* vim: set ft=tiger: */

View file

@ -1,9 +1,9 @@
primitive print(s: string)
/* ^ function */
/* ^ parameter */
/* ^ @function */
/* ^ @parameter */
function func(a: int) : int = (print("Hello World!"); a)
/* ^ function */
/* ^ parameter */
/* ^ function.builtin */
/* ^ @function */
/* ^ @parameter */
/* ^ @function.builtin */
/* vim: set ft=tiger: */

View file

@ -1,30 +1,30 @@
type int = int
/* ^ variable */
/* ^ type.builtin */
/* ^ @variable */
/* ^ @type.builtin */
type int_array = array of int
/* ^ type.builtin */
/* ^ @type.builtin */
type record = {a: int, b: string}
/* ^ property */
/* ^ type.builtin */
/* ^ property */
/* ^ type.builtin */
/* ^ @property */
/* ^ @type.builtin */
/* ^ @property */
/* ^ @type.builtin */
var record := record {a = 12, b = "27"}
/* ^ variable */
/* ^ type */
/* ^ property */
/* ^ property */
/* ^ @variable */
/* ^ @type */
/* ^ @property */
/* ^ @property */
var array := int_array[12] of 27;
/* ^ variable */
/* ^ type */
/* ^ @variable */
/* ^ @type */
primitive func(a: int, b: string) : array
/* ^ parameter */
/* ^ type.builtin */
/* ^ parameter */
/* ^ type.builtin */
/* ^ type */
/* ^ @parameter */
/* ^ @type.builtin */
/* ^ @parameter */
/* ^ @type.builtin */
/* ^ @type */
/* vim: set ft=tiger: */

View file

@ -1,4 +1,4 @@
import "lib.tih"
/* <- include */
/* ^ string.special */
/* <- @include */
/* ^ @string.special */
/* vim: set ft=tiger: */

View file

@ -1,42 +1,42 @@
let
/* <- keyword */
/* <- @keyword */
var a := 12
/* <- keyword */
/* <- @keyword */
function f() : int = a
/* <- keyword.function */
/* <- @keyword.function */
primitive g()
/* <- keyword.function */
/* <- @keyword.function */
import "lib.tih"
/* <- include */
/* <- @include */
type array_of_int = array of int
/* <- keyword */
/* ^ keyword */
/* ^ keyword */
/* <- @keyword */
/* ^ @keyword */
/* ^ @keyword */
in
/* <- keyword */
/* <- @keyword */
12;
if 12 then 27 else 42;
/* <- keyword */
/* ^ keyword */
/* ^ keyword */
/* <- @keyword */
/* ^ @keyword */
/* ^ @keyword */
for i := 12 to 27 do 42;
/* <- repeat */
/* ^ repeat */
/* ^ repeat */
/* <- @repeat */
/* ^ @repeat */
/* ^ @repeat */
while 12 do break
/* <- repeat */
/* ^ repeat */
/* ^ keyword */
/* <- @repeat */
/* ^ @repeat */
/* ^ @keyword */
end
/* <- keyword */
/* <- @keyword */
/* vim: set ft=tiger: */

View file

@ -1,9 +1,9 @@
nil
/* <- constant.builtin */
/* <- @constant.builtin */
42
/* <- number */
/* <- @number */
"Hello World!\n"
/* <- string
^ string.escape
/* <- @string
^ @string.escape
*/
/* vim: set ft=tiger: */

View file

@ -1,14 +1,14 @@
let
_chunks(42)
/* <- keyword */
/* <- @keyword */
in
_lvalue(12) : _namety(42) := _cast("I'm So Meta Even This Acronym", string);
/* <- keyword */
/* ^ keyword */
/* ^ keyword */
/* <- @keyword */
/* ^ @keyword */
/* ^ @keyword */
_exp(42)
/* <- keyword */
/* <- @keyword */
end
/* vim: set ft=tiger: */

View file

@ -1,29 +1,29 @@
let
class A extends Object {}
/* <- keyword */
/* ^ keyword */
/* ^ type.builtin */
/* <- @keyword */
/* ^ @keyword */
/* ^ @type.builtin */
type B = class extends A {
/* ^ keyword */
/* ^ keyword */
/* ^ type */
/* ^ @keyword */
/* ^ @keyword */
/* ^ @type */
var a := 12
method meth() : int = self.a
/* <- keyword.function */
/* ^ method */
/* ^ variable.builtin */
/* <- @keyword.function */
/* ^ @method */
/* ^ @variable.builtin */
}
var object := new B
/* ^ keyword.operator */
/* ^ @keyword.operator */
in
object.a := 27;
/* ^ property */
/* ^ @property */
object.meth()
/* ^ method */
/* ^ @method */
end
/* vim: set ft=tiger: */

View file

@ -1,49 +1,49 @@
let
var a : int := 42
/* ^ punctuation.delimiter */
/* ^ operator */
/* ^ @punctuation.delimiter */
/* ^ @operator */
in
(
/* <- punctuation.bracket */
/* <- @punctuation.bracket */
-1 | 2 & 3 + 4 * 5;
/* <- operator */
/* ^ operator */
/* ^ operator */
/* ^ operator */
/* ^ operator */
/* ^ punctuation.delimiter */
/* <- @operator */
/* ^ @operator */
/* ^ @operator */
/* ^ @operator */
/* ^ @operator */
/* ^ @punctuation.delimiter */
12 >= 27;
/* ^ operator */
/* ^ @operator */
12 <= 27;
/* ^ operator */
/* ^ @operator */
12 = 27;
/* ^ operator */
/* ^ @operator */
12 <> 27;
/* ^ operator */
/* ^ @operator */
12 < 27;
/* ^ operator */
/* ^ @operator */
12 > 27;
/* ^ operator */
/* ^ @operator */
record.field;
/* ^ punctuation.delimiter */
/* ^ @punctuation.delimiter */
func(a, b);
/* ^ punctuation.bracket */
/* ^ punctuation.bracket */
/* ^ punctuation.delimiter */
/* ^ @punctuation.bracket */
/* ^ @punctuation.bracket */
/* ^ @punctuation.delimiter */
record_type { };
/* ^ punctuation.bracket */
/* ^ punctuation.bracket */
/* ^ @punctuation.bracket */
/* ^ @punctuation.bracket */
array[42]
/* ^ punctuation.bracket */
/* ^ punctuation.bracket */
/* ^ @punctuation.bracket */
/* ^ @punctuation.bracket */
)
/* <- punctuation.bracket */
/* <- @punctuation.bracket */
end
/* vim: set ft=tiger: */