1
0

XSCREENとSPDEFとDISPLAY実�

This commit is contained in:
otya128
2015-08-22 22:16:13 +09:00
parent 6a69ba1fb3
commit 8d4a9a2d13
8 changed files with 552 additions and 114 deletions

View File

@@ -1,11 +1,13 @@
module otya.smilebasic.error;
import std.exception;
import std.string;
import std.conv;
class SmileBasicError : Exception
{
int errnum;
int errline;
int errprg;
string message2;
this(int slot, int line, string message)
{
super(format("%s in %d:%d", message, slot, line));
@@ -18,6 +20,11 @@ class SmileBasicError : Exception
{
super(message);
}
this(string message, string message2)
{
super(message);
this.message2 = message2;
}
}
class SyntaxError : SmileBasicError
{
@@ -26,13 +33,18 @@ class SyntaxError : SmileBasicError
this.errnum = 3;
super("Syntax error");
}
this(wstring func)
{
this();
this.message2 = "Undefine function (" ~ func.to!string ~ ")";
}
}
class IllegalFunctionCall : SmileBasicError
{
this()
this(string func)
{
this.errnum = 4;
super("Illegal function call");
super("Illegal function call(" ~ func ~ ")");
}
}
class TypeMismatch : SmileBasicError