From af74ddb119e3c5167a10bf5468af3960c8db42c0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 2 Mar 2019 21:48:30 +0100 Subject: Use 'fn' to define closure to make parsing/reading the language easier It caused issues when you have parentheses to surround math expression, for example: ((func() + 34) * 54) is easier to parse if closure has to begin with 'fn'. Also removed requirement for semicolons. Semicolons can't even be used optionally yet. --- tests/io.amal | 2 +- tests/main.amal | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/io.amal b/tests/io.amal index c75fa2d..bb7935b 100644 --- a/tests/io.amal +++ b/tests/io.amal @@ -1,3 +1,3 @@ -const puts = () { +const puts = fn { } \ No newline at end of file diff --git a/tests/main.amal b/tests/main.amal index 68ddc47..955806f 100644 --- a/tests/main.amal +++ b/tests/main.amal @@ -1,13 +1,13 @@ const io = @import("tests/io.amal") -const main = () { - var hello = () { +const main = fn { + var hello = fn { } const value = "hello" print(value, "world", 356) } -const print = () { +const print = fn { } -- cgit v1.2.3