diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2025-01-03 12:41:41 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2025-01-03 12:41:41 +0100 |
commit | 57e8f84c1465c0fd8daf78d4178c6b18a65e9158 (patch) | |
tree | 48de6696c719a3ce0a016753a87cf8702f3e5ec3 /test | |
parent | ba1bcfa811fe8eab5a2c71ef4a360e8b846ae32b (diff) |
parser
Diffstat (limited to 'test')
-rw-r--r-- | test/const-function-if.mnml | 8 | ||||
-rw-r--r-- | test/parentheses.mnml | 17 |
2 files changed, 23 insertions, 2 deletions
diff --git a/test/const-function-if.mnml b/test/const-function-if.mnml index 48fc4fb..11883cd 100644 --- a/test/const-function-if.mnml +++ b/test/const-function-if.mnml @@ -1,4 +1,4 @@ -const main: function = (input: string): void { +const main: function = (input: string): string { if (input == "hello") { const bye: string = "bye" } @@ -6,4 +6,8 @@ const main: function = (input: string): void { return input } -main(input = "hello") +const main2: function = (input: string): string { + const bye: string = main(input = "bye") + + return main(input = "hello") +} diff --git a/test/parentheses.mnml b/test/parentheses.mnml new file mode 100644 index 0000000..d18aee2 --- /dev/null +++ b/test/parentheses.mnml @@ -0,0 +1,17 @@ +const main: function = (input: string): string { + if ((input == "hello") or input == "bye") { + const bye: string = "bye" + } + + return input +} + +const main2: function = (input: string): string { + const bye: string = main(input = "bye") + + const test: bool = (5 > 6) and ((7 < 8) or (true != false)) + + const test2: string = ((main(input = "test") => main(input = $)) + "test2") + + return main(input = "hello") + bye +} |