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

Method type

chapter14/src/main/java/com/seaofnodes/simple/Parser.java:475–493  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

473 // Parse a "type id" and return "type" (and re-parse "id" in caller) or
474 // return null.
475 private Type type() {
476 int old = _lexer._position;
477 String tname = _lexer.matchId();
478 if( tname==null ) return null;
479 boolean nullable = match("?");
480 Type t = TYPES.get(tname);
481 // Assume a forward-reference type
482 if( t == null ) {
483 int old2 = _lexer._position;
484 String id = _lexer.matchId();
485 if( id==null ) {
486 _lexer._position = old;
487 return null;
488 }
489 TYPES.put(tname,t = TypeStruct.make(tname));
490 _lexer._position = old2; // Reparse ID in caller
491 }
492 return t instanceof TypeStruct obj ? TypeMemPtr.make(obj,nullable) : t;
493 }
494
495
496 /**

Callers 2

parseFieldMethod · 0.95

Calls 6

matchMethod · 0.95
makeMethod · 0.95
makeMethod · 0.95
matchIdMethod · 0.45
getMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected