This commit is contained in:
arookas 2015-12-28 14:17:09 -05:00
parent 6997b75403
commit 7c9aa8fe89

View file

@ -8,9 +8,7 @@ namespace arookas {
}
public sunCompilerException(string format, params object[] args)
: base(String.Format(format, args)) {
}
: base(String.Format(format, args)) { }
}
// exceptions that have a location in the source
@ -21,9 +19,7 @@ namespace arookas {
}
public sunSourceException(string format, params object[] args)
: base(format, args) {
}
: base(format, args) { }
}
public class sunImportException : sunCompilerException {
@ -92,81 +88,62 @@ namespace arookas {
public override string Message { get { return String.Format("Redeclared builtin '{0}'.", Node.Builtin.Value); } }
public sunRedeclaredBuiltinException(sunBuiltinDeclaration node)
: base(node) {
}
: base(node) { }
}
class sunUndefinedFunctionException : sunNodeException<sunFunctionCall> {
public override string Message { get { return String.Format("Undefined function or builtin '{0}'.", Node.Function.Value); } }
public sunUndefinedFunctionException(sunFunctionCall node)
: base(node) {
}
: base(node) { }
}
class sunRedefinedFunctionException : sunNodeException<sunFunctionDefinition> {
public override string Message { get { return String.Format("Redefined function '{0}'.", Node.Function.Value); } }
public sunRedefinedFunctionException(sunFunctionDefinition node)
: base(node) {
}
: base(node) { }
}
class sunUndeclaredVariableException : sunNodeException<sunIdentifier> {
public override string Message { get { return String.Format("Undeclared variable '{0}'.", Node.Value); } }
public sunUndeclaredVariableException(sunIdentifier node)
: base(node) {
}
: base(node) { }
}
class sunRedeclaredVariableException : sunNodeException<sunIdentifier> {
public override string Message { get { return String.Format("Redeclared variable '{0}'.", Node.Value); } }
public sunRedeclaredVariableException(sunIdentifier node)
: base(node) {
}
: base(node) { }
}
class sunAssignConstantException : sunNodeException<sunIdentifier> {
public override string Message { get { return String.Format("Constant '{0}' is read-only.", Node.Value); } }
public sunAssignConstantException(sunIdentifier node)
: base(node) {
: base(node) { }
}
}
class sunRedeclaredParameterException : sunNodeException<sunIdentifier> {
public override string Message { get { return String.Format("Redeclared parameter '{0}'.", Node.Value); } }
public sunRedeclaredParameterException(sunIdentifier node)
: base(node) {
}
: base(node) { }
}
class sunVariadicFunctionException : sunNodeException<sunFunctionDefinition> {
public override string Message { get { return String.Format("Function '{0}' is defined as a variadic function (only builtins may be variadic).", Node.Function.Value); } }
public sunVariadicFunctionException(sunFunctionDefinition node)
: base(node) {
}
: base(node) { }
}
class sunEscapeSequenceException : sunNodeException<sunStringLiteral> {
public override string Message { get { return String.Format("Bad escape sequence in string."); } }
public sunEscapeSequenceException(sunStringLiteral node)
: base(node) {
}
: base(node) { }
}
class sunVariadicParameterListException : sunNodeException<sunParameterList> {
public override string Message { get { return String.Format("Bad variadic parameter list."); } }
public sunVariadicParameterListException(sunParameterList node)
: base(node) {
}
: base(node) { }
}
class sunArgumentCountException : sunNodeException<sunFunctionCall> {
public sunCallableSymbol CalledSymbol { get; private set; }
@ -202,32 +179,24 @@ namespace arookas {
public override string Message { get { return String.Format("Invalid identifier '{0}'.", Node.Value); } }
public sunIdentifierException(sunIdentifier node)
: base(node) {
}
: base(node) { }
}
class sunMissingImportException : sunNodeException<sunImport> {
public override string Message { get { return String.Format("Could not find import file '{0}'.", Node.ImportFile.Value); } }
public sunMissingImportException(sunImport node)
: base(node) {
}
: base(node) { }
}
class sunBreakException : sunNodeException<sunBreak> {
public override string Message { get { return "Break statements must be placed within a loop statement."; } }
public sunBreakException(sunBreak node)
: base(node) {
}
: base(node) { }
}
class sunContinueException : sunNodeException<sunContinue> {
public override string Message { get { return "Continue statements must be placed within a loop statement."; } }
public sunContinueException(sunContinue node)
: base(node) {
}
: base(node) { }
}
}