@@ -13,9 +13,15 @@ template ExceptionWithPosition() { const LexPosition pos; this( const LexPosition pos, string msg, string file=null, size_t line=0, Throwable next=null ) - { super(sprintf!"[%s] %s"(pos, msg), file, line, next); this.pos = pos; } + { + if(pos is null) + super(sprintf!"[??] %s"(msg), file, line, next); + else + super(sprintf!"[%s] %s"(pos, msg), file, line, next); + this.pos = pos; + } } /// Thrown when encountered an EOF in the middle of a lexical token