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

Method positions

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

Returns a string containing just the half-open position intervals of each token. e.g. "[3,4) [4,9)".

(Token[] tokens)

Source from the content-addressed store, hash-verified

149 * token. e.g. "[3,4) [4,9)".
150 */
151 private static String positions(Token[] tokens) {
152 StringBuilder buf = new StringBuilder();
153 for (Token tok : tokens) {
154 if (buf.length() > 0) {
155 buf.append(' ');
156 }
157 buf.append('[').append(tok.start).append(',').append(tok.end).append(')');
158 }
159 return buf.toString();
160 }
161
162 @Test
163 public void testBasics1() throws Exception {

Callers 1

testTokenPositionsMethod · 0.95

Calls 3

lengthMethod · 0.45
appendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected