public static String[] getAssignableLiterals(Type type, Unit unit) { TypeDeclaration dtd = unit.getDefiniteType(type).getDeclaration(); if (dtd instanceof Class) { if (dtd.isInteger()) { return new String[] {"0", "1", "2"}; } if (dtd.isByte()) { return new String[] {"0.byte", "1.byte"}; } else if (dtd.isFloat()) { return new String[] {"0.0", "1.0", "2.0"}; } else if (dtd.isString()) { return new String[] {"\"\"", "\"\"\"\"\"\""}; } else if (dtd.isCharacter()) { return new String[] {"' '", "'\\n'", "'\\t'"}; } else { return new String[0]; } } else if (dtd instanceof Interface) { if (dtd.isIterable()) { return new String[] {"{}"}; } else if (dtd.isSequential() || dtd.isEmpty()) { return new String[] {"[]"}; } else { return new String[0]; } } else { return new String[0]; } }
static boolean isIgnoredLanguageModuleType(TypeDeclaration td) { return !td.isObject() && !td.isAnything() && !td.isString() && !td.isInteger() && !td.isCharacter() && !td.isFloat() && !td.isBoolean(); }