Diff
Not logged in

Differences From Artifact [f9cdaf211a0e9fb0]:

To Artifact [514757ca55e253b4]:


10 10 import std.ctype : isspace, isalnum; 11 11 12 12 /*mixin*/ 13 13 template ExceptionWithPosition() 14 14 { 15 15 const LexPosition pos; 16 16 this( const LexPosition pos, string msg, string file=null, size_t line=0, Throwable next=null ) 17 - { super(sprintf!"[%s] %s"(pos, msg), file, line, next); this.pos = pos; } 17 + { 18 + if(pos is null) 19 + super(sprintf!"[??] %s"(msg), file, line, next); 20 + else 21 + super(sprintf!"[%s] %s"(pos, msg), file, line, next); 22 + this.pos = pos; 23 + } 18 24 } 19 25 20 26 /// Thrown when encountered an EOF in the middle of a lexical token 21 27 22 28 class UnexpectedEOF : Exception 23 29 { 24 30 mixin ExceptionWithPosition;