module feature.types; import std.conv; import std.string : strip; public class Type{ char[] value; string type_name; this(char[] val){ this.value = val.dup; } public string ToString(){ return text(this.value); } } public class StringType : Type { private string strval; this(string val){ this.type_name = "string"; this.strval = strip(val, "\""); super([]); } this(char[] val){ this.type_name = "string"; this.strval = strip(text(val), "\""); super([]); } public static StringType concat(StringType first, StringType second){ StringType res = new StringType(first.strval ~ second.strval); return res; } public override string ToString(){ return this.strval; } } public class IntType : Type { private int intval; this(string val){ this.type_name = "int"; this.intval = val.to!int(); super([]); } this(int val){ this.type_name = "int"; this.intval = val; super([]); } public override string ToString(){ return this.intval.to!string(); } }