aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-02-11 18:17:50 +0100
committerGitHub <noreply@github.com>2021-02-11 18:17:50 +0100
commit6bd482f05c24f0aa1475c02d529f33ece40dee24 (patch)
tree055f54a18f59c9141b58804c8c2ed18e3a05ef50 /src/lib.rs
parent44bbfc1a07d3b970c106408f6de3e83168db8f50 (diff)
parent1f79e974677b48d9cd9d69941de8c2fea3e583c8 (diff)
downloadsylt-6bd482f05c24f0aa1475c02d529f33ece40dee24.tar.gz
Merge pull request #57 from FredTheDino/fancy-call-syntax
fancy call syntax
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index d8d9505..862e9fa 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1046,6 +1046,14 @@ a.a <=> 0"
);
test_multiple!(
+ fancy_call,
+ not: "f := fn {}\n f!\n",
+ one_arg: "f := fn a:int { a <=> 1 }\n f! 1\n",
+ two_arg: "f := fn a:int, b:int { b <=> 3 }\n f! 1, 1 + 2\n",
+ three_arg: "f := fn a:int, b:int, c:int { c <=> 13 }\n f! 1, 1 + 2, 1 + 4 * 3\n",
+ );
+
+ test_multiple!(
newline_regression,
simple: "a := 1 // blargh \na += 1 // blargh \n a <=> 2 // HARGH",
expressions: "1 + 1 // blargh \n 2 // blargh \n // HARGH \n",