(pos)
| 347 | } |
| 348 | |
| 349 | function peg$computePosDetails(pos) { |
| 350 | var details = peg$posDetailsCache[pos], p; |
| 351 | |
| 352 | if (details) { |
| 353 | return details; |
| 354 | } else { |
| 355 | p = pos - 1; |
| 356 | while (!peg$posDetailsCache[p]) { |
| 357 | p--; |
| 358 | } |
| 359 | |
| 360 | details = peg$posDetailsCache[p]; |
| 361 | details = { |
| 362 | line: details.line, |
| 363 | column: details.column |
| 364 | }; |
| 365 | |
| 366 | while (p < pos) { |
| 367 | if (input.charCodeAt(p) === 10) { |
| 368 | details.line++; |
| 369 | details.column = 1; |
| 370 | } else { |
| 371 | details.column++; |
| 372 | } |
| 373 | |
| 374 | p++; |
| 375 | } |
| 376 | |
| 377 | peg$posDetailsCache[pos] = details; |
| 378 | return details; |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | function peg$computeLocation(startPos, endPos) { |
| 383 | var startPosDetails = peg$computePosDetails(startPos), |
no outgoing calls
no test coverage detected