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

Method typeAry

chapter17/src/main/java/com/seaofnodes/simple/Parser.java:718–730  ·  view source on GitHub ↗
( Type t )

Source from the content-addressed store, hash-verified

716
717 // Make an array type of t
718 private TypeMemPtr typeAry( Type t ) {
719 if( t instanceof TypeMemPtr tmp && !tmp._nil )
720 throw error("Arrays of reference types must always be nullable");
721 String tname = "["+t.str()+"]";
722 Type ta = TYPES.get(tname);
723 if( ta != null ) return (TypeMemPtr)ta;
724 // Need make an array type.
725 TypeStruct ts = TypeStruct.makeAry(TypeInteger.BOT,ALIAS++,t,ALIAS++);
726 assert ts.str().equals(tname);
727 TypeMemPtr tary = TypeMemPtr.make(ts);
728 TYPES.put(tname,tary);
729 return tary;
730 }
731
732 /**
733 * Parse an expression of the form:

Callers 2

typeMethod · 0.95
allocMethod · 0.95

Calls 8

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

Tested by

no test coverage detected