From 57e8f84c1465c0fd8daf78d4178c6b18a65e9158 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 3 Jan 2025 12:41:41 +0100 Subject: parser --- test/const-function-if.mnml | 8 ++++++-- test/parentheses.mnml | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 test/parentheses.mnml (limited to 'test') 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 +} -- cgit v1.2.3