aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query/highlights/tiger/built-ins.tig
blob: 9aa649421dccc2cd1d4663a46d79b3c4c37303d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
let
  var a := exit(0)
  /*       ^ @function.builtin */

  primitive exit(ret: int) /* Shadowing the prelude-included built-in */
  /*                  ^ @type.builtin */

  var b := exit(0)
  /*       ^ @function.builtin */

  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')*/

  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')*/
    var d : Object := "This is an object"
    /*      ^ @type.builtin (not sure why it isn't 'type')*/
  in
  end;

  exit(1);
  /* <- @function.builtin */

  print("shadowing is fun");
  /* <- @function.builtin */

  self;
  /* <- @variable.builtin */

  b := print
  /*   ^ @variable */
end
/* vim: set ft=tiger: */