Diff
Not logged in

Differences From Artifact [f9cdaf211a0e9fb0]:

To Artifact [514757ca55e253b4]:


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