Differences From Artifact [2827b7df74d1df19]:
- File
polemy/failure.d
- 2010-11-24 13:22:04 - part of checkin [f9c31f3cd8] on branch trunk - Fixed the null dereference bug when directly wrote "case 1 when 2: 3" in REPL. It was due to null LexPosition in the AST. Now AST.pos !is null is an invariant of AST. (user: kinaba) [annotate]
To Artifact [442c0afd591f3c6a]:
- File
polemy/failure.d
- 2010-11-24 17:44:58 - part of checkin [b993a8ad16] on branch trunk - auto memo and re-run feature of non @value/@macro layers re-re-re-implemented. (user: kinaba) [annotate]
49 template ExceptionWithPosition() 49 template ExceptionWithPosition()
50 { 50 {
51 LexPosition pos; 51 LexPosition pos;
52 this( LexPosition pos, string msg, string file=null, size_t line=0, Thro 52 this( LexPosition pos, string msg, string file=null, size_t line=0, Thro
53 { 53 {
54 string fullmsg = pos is null ? sprintf!("\n[??] %s")(msg) 54 string fullmsg = pos is null ? sprintf!("\n[??] %s")(msg)
55 : sprintf!("\n[%s] %s")(pos, msg); 55 : sprintf!("\n[%s] %s")(pos, msg);
56 for(int i=0; i<callstack_pos.length || i<callstack_msg.length; + | 56 foreach_reverse(i,_; callstack_pos)
57 { 57 {
58 LexPosition p = (i<callstack_pos.length ? callstack_pos[ | 58 LexPosition p = callstack_pos[i];
59 string m = (i<callstack_msg.length ? callstack_msg[ | 59 string m = callstack_msg[i];
60 fullmsg ~= p is null ? sprintf!("\n[??] %s")(m) 60 fullmsg ~= p is null ? sprintf!("\n[??] %s")(m)
61 : sprintf!("\n[%s] %s")(p, m); 61 : sprintf!("\n[%s] %s")(p, m);
62 } 62 }
63 super(fullmsg, file, line, next); 63 super(fullmsg, file, line, next);
64 this.pos = pos; 64 this.pos = pos;
65 } 65 }
66 this( string msg, string file=null, size_t line=0, Throwable next=null ) 66 this( string msg, string file=null, size_t line=0, Throwable next=null )