演算をdouble対応にした
This commit is contained in:
38
SMILEBASIC/error.d
Normal file
38
SMILEBASIC/error.d
Normal file
@@ -0,0 +1,38 @@
|
||||
module otya.smilebasic.error;
|
||||
import std.exception;
|
||||
import std.string;
|
||||
class SmileBasicError : Exception
|
||||
{
|
||||
int errnum;
|
||||
int errline;
|
||||
int errprg;
|
||||
this(int slot, int line, string message)
|
||||
{
|
||||
super(format("%s in %d:%d", message, slot, line));
|
||||
}
|
||||
this(int line, string message)
|
||||
{
|
||||
super(format("%s in %d", message, line));
|
||||
}
|
||||
this(string message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
class TypeMismatch : SmileBasicError
|
||||
{
|
||||
this()
|
||||
{
|
||||
this.errnum = 8;
|
||||
super("Type mismatch");
|
||||
}
|
||||
}
|
||||
class DuplicateVariable : SmileBasicError
|
||||
{
|
||||
this()
|
||||
{
|
||||
this.errnum = 18;
|
||||
super("Duplicate variable");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user