Differences From Artifact [3ad9850246d5111f]:
- File
polemy/parse.d
- 2010-11-26 05:29:24 - part of checkin [f8684f4d69] on branch trunk - changed the desugaring of >>@macro x=e from >>@macro x=e in x to >>@macro x=e in "(macro definition)" for convenience during REPL interaction (user: kinaba) [annotate]
To Artifact [45c4aa9e0628516e]:
- File
polemy/parse.d
- 2010-11-26 07:42:38 - part of checkin [f7e9e77316] on branch trunk - introduced "..." expression, and replaced the pattern match failure with this. (user: kinaba) [annotate]
265 return new Str(pos, lex.front.str); 265 return new Str(pos, lex.front.str);
266 } 266 }
267 if( isNumber(lex.front.str) ) 267 if( isNumber(lex.front.str) )
268 { 268 {
269 scope(exit) lex.popFront; 269 scope(exit) lex.popFront;
270 return new Int(pos, BigInt(cast(string)lex.front.str)); 270 return new Int(pos, BigInt(cast(string)lex.front.str));
271 } 271 }
> 272 if( tryEat("...") )
> 273 {
> 274 return new Die(pos);
> 275 }
272 if( tryEat("@") ) 276 if( tryEat("@") )
273 { 277 {
274 auto lay = "@"~eatId("for layer ID"); 278 auto lay = "@"~eatId("for layer ID");
275 eat("(", "for layered execution"); 279 eat("(", "for layered execution");
276 auto e = Body(); 280 auto e = Body();
277 eat(")", "after "~lay~"(..."); 281 eat(")", "after "~lay~"(...");
278 return new Lay(pos, lay, e); 282 return new Lay(pos, lay, e);
................................................................................................................................................................................
356 return parsePatternMatchCases(casePos, pmVar, failBranch 360 return parsePatternMatchCases(casePos, pmVar, failBranch
357 new Let(pos, tryThisBranchVar, [], 361 new Let(pos, tryThisBranchVar, [],
358 new Fun(pos,[],judgement), thenDoThis) 362 new Fun(pos,[],judgement), thenDoThis)
359 ); 363 );
360 } 364 }
361 else 365 else
362 { 366 {
363 AST doNothing = new Fun(casePos,[], | 367 AST doNothing = new Fun(casePos,[], new Die(casePos));
364 new Str(casePos, sprintf!"(pattern match failure <
365 return new Let(casePos, tryThisBranchVar, [], doNothing, 368 return new Let(casePos, tryThisBranchVar, [], doNothing,
366 } 369 }
367 } 370 }
368 371
369 // hageshiku tenuki 372 // hageshiku tenuki
370 abstract class SinglePattern 373 abstract class SinglePattern
371 { 374 {