From 3b1ba73ad56bdcfb1ffa39ed4c8f1dddeb607adf Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 3 Sep 2024 18:04:11 +0200 Subject: and/or types --- test/test.test | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/test.test b/test/test.test index e39eae6..3778099 100644 --- a/test/test.test +++ b/test/test.test @@ -7,7 +7,7 @@ const new: integer = henshin * 5 + 10; const test: integer = 1 + 1; -function main(input: string): void { +function main(input: string or integer): void { const hello: string = "world!"; const bye: string = "bye!"; @@ -16,12 +16,12 @@ function main(input: string): void { main(input = "hello!"); -const array: [integer][3] = [1, 2, 3]; +const array: [integer] = [1, 2, 3]; const map: [string][string or integer] = [ - "first": 1, - "second": "two", - "third": "3", - "fourth": 4, + "first" = 1, + "second" = "two", + "third" = "3", + "fourth" = 4 ]; for (array) |index, value| { @@ -32,5 +32,34 @@ for (map) |key, value| { ply = key; } -main() |> print($); -main() |> main2($) |> print($); +main() => print($); +main() => main2($) => print($); + +//type test_type = { +// const test_field: string = "test", +// var another_field: integer = 4, +// +// function test_function(): void { +// return test_type.test_field; +// }, +// function_field: function = another_function(): void { +// return test_type.another_field; +// }, +//}; + +// type other_int = integer; + +//const test_type: type = {}; +//const other_int: type = integer; + +//const main: function = function(input: string): void { +// return input; +//}; + +//const main: function = (input: string): void { +// return input; +//}; + +//iterate(array, (index: integer, value: integer) { +// +//}); -- cgit v1.2.3