MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / typeAry

Method typeAry

chapter18/src/main/java/com/seaofnodes/simple/Parser.java:849–861  ·  view source on GitHub ↗
( Type t )

Source from the content-addressed store, hash-verified

847
848 // Make an array type of t
849 private TypeMemPtr typeAry( Type t ) {
850 if( t instanceof TypeMemPtr tmp && tmp.notNull() )
851 throw error("Arrays of reference types must always be nullable");
852 String tname = "["+t.str()+"]";
853 Type ta = TYPES.get(tname);
854 if( ta != null ) return (TypeMemPtr)ta;
855 // Need make an array type.
856 TypeStruct ts = TypeStruct.makeAry(TypeInteger.BOT,ALIAS++,t,ALIAS++);
857 assert ts.str().equals(tname);
858 TypeMemPtr tary = TypeMemPtr.make(ts);
859 TYPES.put(tname,tary);
860 return tary;
861 }
862
863 // A function type is `{ type... -> type }` or `{ type }`.
864 private Type typeFunPtr() {

Callers 2

typeMethod · 0.95
allocMethod · 0.95

Calls 9

errorMethod · 0.95
makeAryMethod · 0.95
strMethod · 0.95
makeMethod · 0.95
notNullMethod · 0.45
strMethod · 0.45
getMethod · 0.45
equalsMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected