Diff
Not logged in

Differences From Artifact [38516f68b159d6bd]:

To Artifact [9aca36046bea5df8]:


98 string kwd = "@" ~ layer; 98 string kwd = "@" ~ layer; 99 string var = layer; 99 string var = layer; 100 100 101 auto e = tryEat("(") 101 auto e = tryEat("(") 102 ? parseLambdaAfterOpenParen(pos) // let var ( . 102 ? parseLambdaAfterOpenParen(pos) // let var ( . 103 : (eat("=", "after "~kwd), E(0)); // let var = . 103 : (eat("=", "after "~kwd), E(0)); // let var = . 104 if( moreDeclarationExists() ) 104 if( moreDeclarationExists() ) 105 return new Let(pos, var, SystemLayer, e, Body()) | 105 return new Let(pos, var, LiftLayer, e, Body()); 106 else 106 else 107 return new Let(pos, var, SystemLayer, e, | 107 return new Let(pos, var, LiftLayer, e, 108 new Lay(pos, SystemLayer, new Var(pos, v | 108 new Lay(pos, LiftLayer, new Var(pos, var 109 ); 109 ); 110 } 110 } 111 else 111 else 112 { 112 { 113 string kwd = layer; 113 string kwd = layer; 114 if( layer.empty && !tryEat(kwd="let") && !tryEat(kwd="va 114 if( layer.empty && !tryEat(kwd="let") && !tryEat(kwd="va 115 return null; // none of {@lay, let, var, def} oc 115 return null; // none of {@lay, let, var, def} oc ................................................................................................................................................................................ 632 assert_eq(parseString(`def foo(x) { x+1 }; foo`), 632 assert_eq(parseString(`def foo(x) { x+1 }; foo`), 633 let("foo", "", 633 let("foo", "", 634 fun(["x"], call(var("+"), var("x"), intl(1))), 634 fun(["x"], call(var("+"), var("x"), intl(1))), 635 var("foo")) 635 var("foo")) 636 ); 636 ); 637 637 638 assert_eq(parseString(`@@type ( x ) { x }`), 638 assert_eq(parseString(`@@type ( x ) { x }`), 639 let("@type", SystemLayer, fun(["x"], var("x")), lay(SystemLayer, | 639 let("@type", LiftLayer, fun(["x"], var("x")), lay(LiftLayer, var 640 640 641 assert_eq(parseString(`{}`), call(var("{}"))); 641 assert_eq(parseString(`{}`), call(var("{}"))); 642 assert_eq(parseString(`{foo:1,"bar":2}`), 642 assert_eq(parseString(`{foo:1,"bar":2}`), 643 call(var(".="), call(var(".="), call(var("{}")), strl("foo"), in 643 call(var(".="), call(var(".="), call(var("{}")), strl("foo"), in 644 assert_eq(parseString(`{}.foo`), call(var("."),call(var("{}")),strl("foo 644 assert_eq(parseString(`{}.foo`), call(var("."),call(var("{}")),strl("foo 645 assert_eq(parseString(`{}.?foo`), call(var(".?"),call(var("{}")),strl("f 645 assert_eq(parseString(`{}.?foo`), call(var(".?"),call(var("{}")),strl("f 646 assert_eq(parseString(`x{y:1}`), call(var(".="),var("x"),strl("y"),intl( 646 assert_eq(parseString(`x{y:1}`), call(var(".="),var("x"),strl("y"),intl(