(input, offset)
| 297 | // into. |
| 298 | |
| 299 | function getLineInfo(input, offset) { |
| 300 | for (var line = 1, cur = 0;;) { |
| 301 | lineBreakG.lastIndex = cur; |
| 302 | var match = lineBreakG.exec(input); |
| 303 | if (match && match.index < offset) { |
| 304 | ++line; |
| 305 | cur = match.index + match[0].length; |
| 306 | } else { |
| 307 | return new Position(line, offset - cur) |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | // A second optional argument can be given to further configure |
| 313 | // the parser process. These options are recognized: |
no outgoing calls
no test coverage detected
searching dependent graphs…