summaryrefslogtreecommitdiff
path: root/test/test.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.test')
-rw-r--r--test/test.test91
1 files changed, 43 insertions, 48 deletions
diff --git a/test/test.test b/test/test.test
index 3778099..149f1a6 100644
--- a/test/test.test
+++ b/test/test.test
@@ -1,65 +1,60 @@
-const henshin: integer = 2; // comment
+const henshin: integer = 2 // comment
// next comment
-var ply: string = "cool!";
-ply = "way cooler!!";
+var ply: string = "cool!"
+ply = "way cooler!!"
-const new: integer = henshin * 5 + 10;
+const new: integer = henshin + 5 * 10
-const test: integer = 1 + 1;
+const test: integer = 1 + 1
-function main(input: string or integer): void {
- const hello: string = "world!";
- const bye: string = "bye!";
+const main: function = (input: string or integer): void {
+ const hello: string = input + " world!"
+ const bye: string = "bye!"
- return hello;
+ return hello + " " + bye
}
-main(input = "hello!");
+const x: string = main(input = "hello!")
+print(x)
-const array: [integer] = [1, 2, 3];
+const array: [integer] = [1, 2, 3]
const map: [string][string or integer] = [
"first" = 1,
"second" = "two",
"third" = "3",
- "fourth" = 4
-];
-
-for (array) |index, value| {
- ply = value;
-}
-
-for (map) |key, value| {
- ply = key;
+ "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
+ }
}
-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;
-// },
-//};
+const other_int: type = integer
-// type other_int = integer;
+const inherited_type: type[test_type] = {
+ const nested: test_type = test_type()
-//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;
-//};
+ const new_function: function = (): void {
+ return self.another_field + 4
+ }
+}
-//iterate(array, (index: integer, value: integer) {
-//
-//});
+const object: inherited_type = inherited_type()
+//object.test_field = "hey"
+//object.test_function() => print($)
+//object.nested.another_function(add = 2)