示例#1
0
 public static bool IsValidHeapType(Type type, ArmadaStructs structs)
 {
     if (type is PointerType pt)
     {
         return(IsValidHeapType(pt.Arg, structs));
     }
     else if (IsPrimitiveType(type))
     {
         return(true);
     }
     else if (type is UserDefinedType ut)
     {
         return(structs.DoesStructExist(ut.Name)); // Datatypes aren't allowed on the heap, only structs
     }
     else if (type is SizedArrayType at)
     {
         return(IsValidHeapType(at.Range, structs));
     }
     else
     {
         return(false);
     }
 }
示例#2
0
 public bool DoesStructExist(string structName)
 {
     return(structs.DoesStructExist(structName));
 }