1
0

演算をdouble対応にした

This commit is contained in:
otya128
2015-06-07 19:11:18 +09:00
parent c871927bc3
commit 978a7a6ee7
5 changed files with 139 additions and 26 deletions

38
SMILEBASIC/error.d Normal file
View 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");
}
}