Differences From Artifact [de23904b83613a4d]:
- File        
polemy/parse.d
- 2010-11-27 14:23:54 - part of checkin [005474ba5b] on branch trunk - changed: not to lift _|_ (user: kinaba) [annotate]
 
 
To Artifact [06d6eadbdf402360]:
- File        
polemy/parse.d
- 2010-11-27 23:46:51 - part of checkin [576c494e53] on branch trunk - fixed: literal "..." is now lifted in user-defined layers (user: kinaba) [annotate]
 
 
   313    313    {
   314    314     auto cond = E(0);
   315    315     auto thenPos = currentPosition();
   316    316     if(!tryEat(":")) {
   317    317      eat("then", "after if condition");
   318    318      tryEat(":");
   319    319     }
   320         -  AST th = E(0);
          320  +  AST th = Body();
   321    321     auto el = doNothingExpression();
   322    322     auto elsePos = currentPosition();
   323    323     if( tryEat("else") ) {
   324    324      tryEat(":");
   325         -   el = E(0);
          325  +   el = Body();
   326    326     }
   327    327     return new App(pos, new Var(pos,"if"), cond, new Fun(thenPos,[],th), new Fun(elsePos,[],el));
   328    328    }
   329    329   
   330    330    AST parsePatternMatch(LexPosition pos)
   331    331    {
   332    332     //   case pmExpr CASES
................................................................................
   349    349     if( tryEat("when") )
   350    350     {
   351    351      auto pos = currentPosition();
   352    352      string failBranchVar = freshVarName();
   353    353   
   354    354      auto pr = parsePattern();
   355    355      eat(":", "after when pattern");
   356         -   AST cBody = E(0);
          356  +   AST cBody = Body();
   357    357      AST judgement = new App(pos, new Var(pos, "if"),
   358    358       ppTest(pmVar, pr), new Fun(pos,[],ppBind(pmVar, pr, cBody)),
   359    359       new Var(pos, failBranchVar));
   360    360      return parsePatternMatchCases(casePos, pmVar, failBranchVar,
   361    361       new Let(pos, tryThisBranchVar, [],
   362    362        new Fun(pos,[],judgement), thenDoThis)
   363    363      );