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

Method typeAry

chapter22/src/main/java/com/seaofnodes/simple/Parser.java:899–910  ·  view source on GitHub ↗
( Type t )

Source from the content-addressed store, hash-verified

897
898 // Make an array type of t
899 private TypeMemPtr typeAry( Type t ) {
900 if( t instanceof TypeMemPtr tmp && tmp.notNull() )
901 throw error("Arrays of reference types must always be nullable");
902 String tname = "["+t.str()+"]";
903 Type ta = TYPES.get(tname);
904 if( ta != null ) return (TypeMemPtr)ta;
905 TypeStruct ts = TypeStruct.makeAry(tname,TypeInteger.U32,_code.getALIAS(),t,_code.getALIAS());
906 assert ts.str().equals(tname);
907 TypeMemPtr tary = TypeMemPtr.make(ts);
908 TYPES.put(tname,tary);
909 return tary;
910 }
911
912 // A function type is `{ type... -> type }` or `{ type }`.
913 private Type typeFunPtr() {

Callers 3

typeMethod · 0.95
allocMethod · 0.95
newStringMethod · 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