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

Method typeAry

chapter21/src/main/java/com/seaofnodes/simple/Parser.java:851–863  ·  view source on GitHub ↗
( Type t )

Source from the content-addressed store, hash-verified

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

Callers 2

typeMethod · 0.95
allocMethod · 0.95

Calls 10

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

Tested by

no test coverage detected