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

Method parseIf

chapter21/src/main/java/com/seaofnodes/simple/Parser.java:509–514  ·  view source on GitHub ↗

Parses a statement if ( expression ) statement [else statement] @return a Node, never null

()

Source from the content-addressed store, hash-verified

507 // Parse predicate
508 require("(");
509 var pred = require(parseAsgn(), ")");
510 return parseTrinary(pred,true,"else");
511 }
512
513 // Parse a conditional expression, merging results.
514 private Node parseTrinary( Node pred, boolean stmt, String fside ) {
515 pred.keep();
516
517 // IfNode takes current control and predicate

Callers 1

parseStatementMethod · 0.95

Calls 3

requireMethod · 0.95
parseAsgnMethod · 0.95
parseTrinaryMethod · 0.95

Tested by

no test coverage detected