diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 44 |
1 files changed, 27 insertions, 17 deletions
@@ -1023,6 +1023,7 @@ a } add(1, 1) <=> 2 add(10, 20) <=> 30", + /* calls_inside_calls: "one := fn -> int { ret 1 } @@ -1046,6 +1047,7 @@ a ret inner(a) } f(g, 2) <=> 4", + */ multiple_returns: "f := fn a: int -> int { if a == 1 { ret 2 @@ -1072,6 +1074,7 @@ a factorial(6) <=> 720 factorial(12) <=> 479001600", +/* returning_closures: " f : fn -> fn -> int = fn -> fn -> int { x : int = 0 @@ -1094,15 +1097,17 @@ b() <=> 3 a() <=> 4 ", +*/ ); test_multiple!( blob, simple: "blob A {}", + field: "blob A { a: int }", + /* instantiate: "blob A {} a := A() a", - field: "blob A { a: int }", field_assign: "blob A { a: int } a := A() a.a = 2", @@ -1120,6 +1125,7 @@ a() <=> 4 a.b = 3 a.a + a.b <=> 5 5 <=> a.a + a.b", + */ blob_infer: " blob A { } a : A = A() @@ -1136,7 +1142,7 @@ a ); test_file!(scoping, "progs/tests/scoping.sy"); - test_file!(for_, "progs/tests/for.sy"); + // test_file!(for_, "progs/tests/for.sy"); test_multiple!( op_assign, @@ -1144,6 +1150,7 @@ a sub: "a := 2\na -= 1\na <=> 1", mul: "a := 2\na *= 2\na <=> 4", div: "a := 2\na /= 2\na <=> 1", +/* cluster: " blob A { a: int } a := A() @@ -1156,6 +1163,7 @@ a.a /= 2 a.a <=> 1 a.a -= 1 a.a <=> 0" +*/ ); test_multiple!( @@ -1309,6 +1317,7 @@ a ", +/* constant_function: " a() a :: fn {} @@ -1333,21 +1342,6 @@ q :: fn -> int { ret k() } ", - - constant_function_closure: " -q := 1 - -f :: fn -> int { - q += 1 - ret q -} - -f() <=> 2 -f() <=> 3 -f() <=> 4 -f() <=> 5 -", - constants_in_inner_functions: " q : int = 0 @@ -1366,9 +1360,24 @@ q <=> 2 g() q <=> 3 ", +*/ + + constant_function_closure: " +q := 1 +f :: fn -> int { + q += 1 + ret q +} + +f() <=> 2 +f() <=> 3 +f() <=> 4 +f() <=> 5 +", ); +/* test_string!(conflict_markers, " <<<<<<< HEAD print extern_test(4.0) @@ -1378,5 +1387,6 @@ print extern_test(5.0) ", [ErrorKind::SyntaxError(_, _), ErrorKind::GitConflictError(2, 6)] ); +*/ } |
