summaryrefslogtreecommitdiff
path: root/test/test.test
blob: 149f1a6d22ea0936c93b9934b8324716f2f9a2f7 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const henshin: integer = 2 // comment
// next comment
var ply: string = "cool!"
ply = "way cooler!!"

const new: integer = henshin + 5 * 10

const test: integer = 1 + 1

const main: function = (input: string or integer): void {
  const hello: string = input + " world!"
  const bye: string = "bye!"

  return hello + " " + bye
}

const x: string = main(input = "hello!")
print(x)

const array: [integer] = [1, 2, 3]
const map: [string][string or integer] = [
  "first" = 1,
  "second" = "two",
  "third" = "3",
  "fourth" = 4,
  "fifth" = (): void {
    return "5."
  },
]

main("pipe1") => print($)
main("pipe2") => main($) => print($)

const test_type: type = {
  const test_field: string = "test"
  var another_field: integer = 4

  const test_function: function = (): void {
    return self.test_field
  }

  const another_function: function = (add: integer): integer {
    return self.another_field + add
  }
}

const other_int: type = integer

const inherited_type: type[test_type] = {
  const nested: test_type = test_type()

  const new_function: function = (): void {
    return self.another_field + 4
  }
}

const object: inherited_type = inherited_type()
//object.test_field = "hey"
//object.test_function() => print($)
//object.nested.another_function(add = 2)