(charIndex)
| 15611 | }) |
| 15612 | } |
| 15613 | getAtomIndexAtCharacterIndex(charIndex) { |
| 15614 | // todo: is this correct thinking for handling root? |
| 15615 | if (this.isRoot()) return 0 |
| 15616 | const numberOfIndents = this._getIndentLevel(undefined) - 1 |
| 15617 | // todo: probably want to rewrite this in a performant way. |
| 15618 | const spots = [] |
| 15619 | while (spots.length < numberOfIndents) { |
| 15620 | spots.push(-(numberOfIndents - spots.length)) |
| 15621 | } |
| 15622 | this.atoms.forEach((atom, atomIndex) => { |
| 15623 | atom.split("").forEach(letter => { |
| 15624 | spots.push(atomIndex) |
| 15625 | }) |
| 15626 | spots.push(atomIndex) |
| 15627 | }) |
| 15628 | return spots[charIndex] |
| 15629 | } |
| 15630 | // Note: This currently does not return any errors resulting from "required" or "single" |
| 15631 | getAllErrors(lineStartsAt = 1) { |
| 15632 | const errors = [] |
no test coverage detected