Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 public static Boolean IsIndexable(this Runtime.VarType type)
 {
     return(type == Runtime.VarType.String || type == Runtime.VarType.Array || type == Runtime.VarType.Truple);
 }
Exemplo n.º 3
0
 public static Boolean IsNumber(this Runtime.VarType type)
 {
     return(type == Runtime.VarType.Integer ||
            type == Runtime.VarType.Float);
 }
Exemplo n.º 4
0
 public static Boolean IsPrimitive(this Runtime.VarType type)
 {
     return(type <= Runtime.VarType.Bool);
 }