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

Method values

src/test/java/net/starlark/java/syntax/LexerTest.java:105–117  ·  view source on GitHub ↗

Returns a string containing the names of the tokens and their associated values. (String-literals are printed without escaping.)

(Token[] tokens)

Source from the content-addressed store, hash-verified

103 * values. (String-literals are printed without escaping.)
104 */
105 private static String values(Token[] tokens) {
106 StringBuilder buffer = new StringBuilder();
107 for (Token token : tokens) {
108 if (buffer.length() > 0) {
109 buffer.append(' ');
110 }
111 buffer.append(token.kind.name());
112 if (token.value != null) {
113 buffer.append('(').append(token.value).append(')');
114 }
115 }
116 return buffer.toString();
117 }
118
119 // Scans src, and asserts that the tokens match wantTokens
120 // and that there are no errors.

Calls 4

nameMethod · 0.65
lengthMethod · 0.45
appendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected