Renamed 'sunScriptException' to 'sunSourceException'.

This commit is contained in:
arookas 2015-12-13 00:57:21 -05:00
parent dfde9c2b20
commit 6edee006ad
3 changed files with 8 additions and 8 deletions

View file

@ -35,9 +35,9 @@ namespace arookas
} }
else else
{ {
if (results.Error is sunScriptException) if (results.Error is sunSourceException)
{ {
var error = results.Error as sunScriptException; var error = results.Error as sunSourceException;
Error(" in file \"{0}\"\n at line {1}, col {2}\n\n{3}{4}", error.Location.File, error.Location.Line, error.Location.Column, GetErrorPreview(error.Location), error.Message); Error(" in file \"{0}\"\n at line {1}, col {2}\n\n{3}{4}", error.Location.File, error.Location.Line, error.Location.Column, GetErrorPreview(error.Location), error.Message);
exitCode = 1; exitCode = 1;
} }

View file

@ -35,7 +35,7 @@ Use the various properties on this type to gather the information of the compila
|`FunctionCount`|The total number of function symbols created.| |`FunctionCount`|The total number of function symbols created.|
|`VariableCount`|The total number of global-scope variable symbols created.| |`VariableCount`|The total number of global-scope variable symbols created.|
If the error is of the type `sunScriptException`, you can cast and retrieve the script name, line, and column of the error. If the error is of the type `sunSourceException`, you can cast and retrieve the script name, line, and column of the error.
## Compiling ## Compiling

View file

@ -18,15 +18,15 @@ namespace arookas
} }
// exceptions that have a location in the source // exceptions that have a location in the source
public abstract class sunScriptException : sunCompilerException public abstract class sunSourceException : sunCompilerException
{ {
public abstract sunSourceLocation Location { get; } public abstract sunSourceLocation Location { get; }
public sunScriptException() public sunSourceException()
{ {
} }
public sunScriptException(string format, params object[] args) public sunSourceException(string format, params object[] args)
: base(format, args) : base(format, args)
{ {
@ -55,7 +55,7 @@ namespace arookas
} }
// wrapper around Grammatica exceptions // wrapper around Grammatica exceptions
class sunParserException : sunScriptException class sunParserException : sunSourceException
{ {
string file; string file;
@ -79,7 +79,7 @@ namespace arookas
} }
// node exceptions // node exceptions
abstract class sunNodeException<TNode> : sunScriptException where TNode : sunNode abstract class sunNodeException<TNode> : sunSourceException where TNode : sunNode
{ {
public TNode Node { get; private set; } public TNode Node { get; private set; }
public override sunSourceLocation Location { get { return Node.Location; } } public override sunSourceLocation Location { get { return Node.Location; } }