enum Type {
DOT, ID, MODULE, /* etc ....*/
}would actually work and you can get a string out of it with std.conv.to:
import std.conv; Type t = Type.DOT; string s = to!string(t); assert(s == "DOT");
enum Type {
DOT, ID, MODULE, /* etc ....*/
}would actually work and you can get a string out of it with std.conv.to:
import std.conv; Type t = Type.DOT; string s = to!string(t); assert(s == "DOT");