ASSERT関数を実装,関数定義の後のコードが実行されない問題を修正
This commit is contained in:
@@ -94,6 +94,14 @@ class BuiltinFunction
|
||||
{
|
||||
p.cls;
|
||||
}
|
||||
static void ASSERT__(PetitComputer p, int cond, wstring message)
|
||||
{
|
||||
if(!cond)
|
||||
{
|
||||
p.printConsole("Assertion failed: ", message, "\n");
|
||||
}
|
||||
assert(cond, message.to!string);
|
||||
}
|
||||
//alias void function(PetitComputer, Value[], Value[]) BuiltinFunc;
|
||||
static BuiltinFunction[wstring] builtinFunctions;
|
||||
static this()
|
||||
@@ -202,6 +210,10 @@ template GetFunctionParamType(T, string N)
|
||||
{
|
||||
const string arg = "ValueType.Integer, false";
|
||||
}
|
||||
else static if(is(P[0] == wstring))
|
||||
{
|
||||
const string arg = "ValueType.String, false";
|
||||
}
|
||||
else static if(is(P[0] == DefaultValue!int))
|
||||
{
|
||||
const string arg = "ValueType.Integer, true";
|
||||
@@ -250,6 +262,11 @@ template AddFuncArg(int L, int N, int M, P...)
|
||||
enum add = 1;
|
||||
const string arg = "arg[" ~ I.to!string ~ "].castInteger";
|
||||
}
|
||||
else static if(is(P[0] == wstring))
|
||||
{
|
||||
enum add = 1;
|
||||
const string arg = "arg[" ~ I.to!string ~ "].castString";
|
||||
}
|
||||
else static if(is(P[0] == DefaultValue!int))
|
||||
{
|
||||
enum add = 1;
|
||||
|
||||
Reference in New Issue
Block a user