Exemple #1
0
 internal void AddType(string name, ReflectedType rt)
 {
     if (string.IsNullOrEmpty(name))
     {
         throw new ArgumentNullException("name");
     }
     if (null == rt)
     {
         throw new ArgumentNullException("rt");
     }
     if (types == null)
     {
         types = new Dictionary <SymbolId, ReflectedType>();
     }
     types[SymbolTable.StringToId(name)] = rt;
 }
Exemple #2
0
 internal Inferred InferType(Type type)
 {
     if (type == typeof(int))
     {
         return(inferredInt);
     }
     else if (type == typeof(IronMath.BigInteger))
     {
         return(inferredBgi);
     }
     else if (type == typeof(IronMath.Complex64))
     {
         return(inferredCpx);
     }
     else if (type == typeof(double))
     {
         return(inferredDbl);
     }
     else if (type == typeof(string))
     {
         return(inferredStr);
     }
     else if (type == typeof(FoxPro.Runtime.Tuple))
     {
         return(inferredTpl);
     }
     else if (type == typeof(FoxPro.Runtime.List))
     {
         return(inferredLst);
     }
     else if (type == typeof(FoxPro.Runtime.Dict))
     {
         return(inferredDct);
     }
     else
     {
         ReflectedType rt;
         if (!reflected.TryGetValue(type, out rt))
         {
             rt = new ReflectedType(type);
             reflected[type] = rt;
         }
         return(rt);
     }
 }
Exemple #3
0
 public bool TryGetBuiltin(string name, out ReflectedType scope)
 {
     return(types.TryGetValue(SymbolTable.StringToId(name), out scope));
 }