Returns a string containing just the half-open position intervals of each token. e.g. "[3,4) [4,9)".
(Token[] tokens)
| 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 { |
no test coverage detected