1
0

64bit環境でとりあえずコンパイルできるようにした

This commit is contained in:
otya128
2015-08-26 21:55:55 +09:00
parent 435138c8d1
commit 478c3a397e
4 changed files with 17 additions and 19 deletions

View File

@@ -112,7 +112,7 @@ class VM
} }
void end() void end()
{ {
pc = code.length; pc = cast(int)code.length;
} }
void dump() void dump()
{ {

View File

@@ -274,7 +274,7 @@ class BuiltinFunction
//hairetuha? //hairetuha?
static int LEN(wstring str) static int LEN(wstring str)
{ {
return str.length; return cast(int)str.length;
} }
static double VAL(wstring str) static double VAL(wstring str)
{ {
@@ -360,8 +360,7 @@ class BuiltinFunction
str1 = vstart.castString; str1 = vstart.castString;
str2 = vstr1.castString; str2 = vstr1.castString;
} }
int aaa = str1[start..$].indexOf(str2, CaseSensitive.no); return cast(int)(str1[start..$].indexOf(str2, CaseSensitive.no));
return str1[start..$].indexOf(str2, CaseSensitive.no);
} }
static int ASC(wstring str) static int ASC(wstring str)
{ {
@@ -508,7 +507,6 @@ class BuiltinFunction
return; return;
} }
throw new IllegalFunctionCall("SPDEF"); throw new IllegalFunctionCall("SPDEF");
return;
} }
default: default:
} }
@@ -587,7 +585,7 @@ class BuiltinFunction
auto f = format[i]; auto f = format[i];
if(f == '%') if(f == '%')
{ {
int d = indexOf(format, 'D', CaseSensitive.yes); int d = cast(int)indexOf(format, 'D', CaseSensitive.yes);
if(d != -1) if(d != -1)
{ {
auto spec = singleSpec(format[i .. d + 1]); auto spec = singleSpec(format[i .. d + 1]);
@@ -597,7 +595,7 @@ class BuiltinFunction
i = d; i = d;
continue; continue;
} }
d = indexOf(format, 'X', CaseSensitive.yes); d = cast(int)indexOf(format, 'X', CaseSensitive.yes);
if(d != -1) if(d != -1)
{ {
auto spec = singleSpec(format[i .. d + 1]); auto spec = singleSpec(format[i .. d + 1]);
@@ -607,7 +605,7 @@ class BuiltinFunction
i = d; i = d;
continue; continue;
} }
d = indexOf(format, 'S', CaseSensitive.yes); d = cast(int)indexOf(format, 'S', CaseSensitive.yes);
if(d != -1) if(d != -1)
{ {
auto spec = singleSpec(format[i .. d + 1]); auto spec = singleSpec(format[i .. d + 1]);
@@ -617,7 +615,7 @@ class BuiltinFunction
i = d; i = d;
continue; continue;
} }
d = indexOf(format, 'F', CaseSensitive.yes); d = cast(int)indexOf(format, 'F', CaseSensitive.yes);
if(d != -1) if(d != -1)
{ {
auto spec = singleSpec(format[i .. d + 1]); auto spec = singleSpec(format[i .. d + 1]);

View File

@@ -385,7 +385,7 @@ class Compiler
IndexExpressions ie = cast(IndexExpressions)binop.item2; IndexExpressions ie = cast(IndexExpressions)binop.item2;
if(ie) if(ie)
{ {
genCode(new PushArray(ie.expressions.length)); genCode(new PushArray(cast(int)ie.expressions.length));
} }
else else
{ {
@@ -428,12 +428,12 @@ class Compiler
} }
if(bfun) if(bfun)
{ {
genCode(new CallBuiltinFunction(bfun, func.args.length, 1)); genCode(new CallBuiltinFunction(bfun, cast(int)func.args.length, 1));
} }
else else
{ {
writeln(func.name); writeln(func.name);
genCode(new CallFunctionCode(func.name, func.args.length)); genCode(new CallFunctionCode(func.name, cast(int)func.args.length));
} }
} }
break; break;
@@ -481,7 +481,7 @@ class Compiler
getVarIndex(var.name, sc, index, local); getVarIndex(var.name, sc, index, local);
if(ie) if(ie)
{ {
genCode(new PopArray(index, ie.expressions.length, local)); genCode(new PopArray(index, cast(int)ie.expressions.length, local));
} }
else else
{ {
@@ -508,14 +508,14 @@ class Compiler
if(node.hasElse) if(node.hasElse)
{ {
then = genCodeGoto(); then = genCodeGoto();
else_.address = code.length; else_.address = cast(int)code.length;
compileStatements(node.else_, sc); compileStatements(node.else_, sc);
then.address = code.length; then.address = cast(int)code.length;
} }
else else
{ {
//endifに飛ばす //endifに飛ばす
else_.address = code.length; else_.address = cast(int)code.length;
} }
} }
void compileFor(For node, Scope s) void compileFor(For node, Scope s)
@@ -540,7 +540,7 @@ class Compiler
genCodeOP(TokenType.Greater); genCodeOP(TokenType.Greater);
auto breakAddr = genCodeGotoTrue(); auto breakAddr = genCodeGotoTrue();
auto forAddr = genCodeGoto(); auto forAddr = genCodeGoto();
positiveZero.address = code.length; positiveZero.address = cast(int)code.length;
//stepが正の値の時の処理 //stepが正の値の時の処理
//toよりcounterが大きい場合はBREAK //toよりcounterが大きい場合はBREAK
//t c //t c
@@ -551,7 +551,7 @@ class Compiler
genCodePushVar(node.initExpression.name, s); genCodePushVar(node.initExpression.name, s);
genCodeOP(TokenType.Less); genCodeOP(TokenType.Less);
genCode(breakAddr); genCode(breakAddr);
forAddr.address = code.length; forAddr.address = cast(int)code.length;
s = new Scope(new GotoAddr(-1), new GotoAddr(-1), s); s = new Scope(new GotoAddr(-1), new GotoAddr(-1), s);
compileStatements(node.statements, s); compileStatements(node.statements, s);
s.continueAddr.address = code.length; s.continueAddr.address = code.length;

View File

@@ -151,7 +151,7 @@ class Array(T)
{ {
array[] = 0; array[] = 0;
} }
dimCount = dim.length; dimCount = cast(int)dim.length;
} }
T opIndexAssign(T v, int[] dim) T opIndexAssign(T v, int[] dim)
{ {