1
0

型チェックをするようにした

This commit is contained in:
otya128
2015-06-07 16:38:53 +09:00
parent 1201467230
commit c871927bc3
6 changed files with 80 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
module otya.smilebasic.type;
enum ValueType : byte
{
Void,//DEF A()ENDの返り値とか未初期化の変数とか
Integer,
Double,
String,
@@ -34,6 +35,14 @@ struct Value
this.type = ValueType.String;
stringValue = value;
}
this(ValueType type)
{
this.type = type;
if(type == ValueType.String)
{
stringValue = "";
}
}
void castOp(ValueType type)
{
switch(type)