MCPcopy
hub / github.com/bazelbuild/bazel / str

Method str

src/main/java/net/starlark/java/eval/Printer.java:133–144  ·  view source on GitHub ↗

Appends the StarlarkValue.str representation of a value to the printer's buffer. Unlike repr(x), it does not quote strings at top level, though strings and other values appearing as elements of other structures are quoted as if by repr. Implementations of StarlarkValue ma

(Object o, StarlarkSemantics semantics)

Source from the content-addressed store, hash-verified

131 * <p>Implementations of StarlarkValue may define their own behavior of {@code str}.
132 */
133 public Printer str(Object o, StarlarkSemantics semantics) {
134 if (o instanceof String) {
135 return this.append((String) o);
136
137 } else if (o instanceof StarlarkValue) {
138 ((StarlarkValue) o).str(this, semantics);
139 return this;
140
141 } else {
142 return this.repr(o);
143 }
144 }
145
146 /**
147 * Appends the {@code StarlarkValue.repr} (quoted) representation of a value to the printer's

Callers 2

processOpeningBraceMethod · 0.95
debugPrintMethod · 0.95

Calls 3

appendMethod · 0.95
reprMethod · 0.95
strMethod · 0.65

Tested by

no test coverage detected