Goldie: Exception
Parsing System (v0.9)
Goldie Home (v0.9) -> GoldieLib Reference -> Exception

Exception

This includes functionality for when a parsed source contains errors.

module goldie.exception

This isn't actually a thrown exception. It's just used to represent a single lexing error.

string file
ptrdiff_t line
ptrdiff_t pos
Filename, line number, and "column number" of the error. Note Goldie's conventions regarding line and column numbers.
string content
The actual piece of source that failed to lex.
readonly @property string printableContent
Like content, but with non-printable characters removed.
string toString()
Ready-to-display string representation in the following format:
{file}({line}:{pos}): Syntax Error: '{printableContent}'

module goldie.exception

Thrown upon any lexing or parsing error.

Parser parser
Lexer lexer

The lexer and parser used when the error occurred. These can be inspected to obtain more information about the error.

Under certain circumstances, either or both of these may be null, so make sure to check for null before using.

string msg
Ready-to-display string representation of the error, including filename (if available) and line and column numbers.
this(string msg)
this(Parser parser, string msg)
Constructors.

module goldie.exception

module goldie.exception

module goldie.exception

module goldie.exception

module goldie.exception

module goldie.exception

Thrown when a problem occurs loading a CGT language file.

StdioException is part of D's standard library.

this(string msg="", string lang="", Exception next=null)
Constructor.

module goldie.exception

Thrown when Goldie tries to load a CGT language file, but cannot find the file.

this(string lang, Exception next=null)
Constructor.

module goldie.exception

Thrown when an invalid argument is passed to a Goldie function.

this(string msg)
Constructor.