MCPcopy Index your code
hub / github.com/antlr/codebuff / writeObjectWithOptions

Method writeObjectWithOptions

output/java8/1.4.19/Interpreter.java:655–682  ·  view source on GitHub ↗

Write out an expression result that uses expression options. E.g.,

(STWriter out, InstanceScope scope, Object o, Object[] options)

Source from the content-addressed store, hash-verified

653 */
654
655 protected int writeObjectWithOptions(STWriter out, InstanceScope scope, Object o, Object[] options) {
656 int start = out.index(); // track char we're about to write
657 // precompute all option values (render all the way to strings)
658 String[] optionStrings = null;
659 if ( options!=null ) {
660 optionStrings = new String[options.length];
661 for (int i = 0; i < Compiler.NUM_OPTIONS; i++) {
662 optionStrings[i] = toString(out, scope, options[i]);
663 }
664 }
665 if ( options!=null && options[Option.ANCHOR.ordinal()] !=null ) {
666 out.pushAnchorPoint();
667 }
668
669 int n = writeObject(out, scope, o, optionStrings);
670 if ( options!=null && options[Option.ANCHOR.ordinal()] !=null ) {
671 out.popAnchorPoint();
672 }
673 if ( debug ) {
674 EvalExprEvent e = new EvalExprEvent(scope,
675 start,
676 out.index()-1,
677 getExprStartChar(scope),
678 getExprStopChar(scope));
679 trackDebugEvent(scope, e);
680 }
681 return n;
682 }
683
684 /** Generic method to emit text for an object. It differentiates
685 * between templates, iterable objects, and plain old Java objects (POJOs)

Callers 1

_execMethod · 0.95

Calls 9

toStringMethod · 0.95
writeObjectMethod · 0.95
getExprStartCharMethod · 0.95
getExprStopCharMethod · 0.95
trackDebugEventMethod · 0.95
indexMethod · 0.65
ordinalMethod · 0.65
pushAnchorPointMethod · 0.65
popAnchorPointMethod · 0.65

Tested by

no test coverage detected