public static Runtime.VarType GetTokenConstantVarType(this Tokenization.TokenType type, Runtime.VarType preferredNumber = Runtime.VarType.Integer) { if (type == Tokenization.TokenType.MetaString) { return(Runtime.VarType.MetaString); } else if (type == Tokenization.TokenType.Number) { return(preferredNumber); } else if (type == Tokenization.TokenType.String) { return(Runtime.VarType.String); } else if (type == Tokenization.TokenType.ResourceVar) { return(Runtime.VarType.ResourceVar); } else { throw new NotImplementedException(); } }
public static Boolean IsIndexable(this Runtime.VarType type) { return(type == Runtime.VarType.String || type == Runtime.VarType.Array || type == Runtime.VarType.Truple); }
public static Boolean IsNumber(this Runtime.VarType type) { return(type == Runtime.VarType.Integer || type == Runtime.VarType.Float); }
public static Boolean IsPrimitive(this Runtime.VarType type) { return(type <= Runtime.VarType.Bool); }