This commit is contained in:
Umur Ozkul 2022-05-19 20:45:15 +02:00
parent ffedc5dbb3
commit 75c913fac3

View File

@ -80,6 +80,7 @@ describe("Peggy to Expression", () => {
(), (),
) // Function definitions become lambda assignments ) // Function definitions become lambda assignments
testToExpression("identity(x)", "(:$$block (:identity :x))", ()) // Note value returns error properly testToExpression("identity(x)", "(:$$block (:identity :x))", ()) // Note value returns error properly
testToExpression("f(x) = x> 2 ? 0 : 1; f(3)", "(:$$block (:$let :f (:$$lambda [x] (:$$block (:$$ternary (:larger :x 2) 0 1)))) (:f 3))", ~v="0", ())
}) })
describe("arrays", () => { describe("arrays", () => {
@ -183,6 +184,7 @@ describe("Peggy to Expression", () => {
~v="{x: 1,y: 99}", ~v="{x: 1,y: 99}",
(), (),
) )
}) })
describe("lambda", () => { describe("lambda", () => {