summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/const-function-if.mnml8
-rw-r--r--test/parentheses.mnml17
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
+}