* Bump the parser until the pattern character is found and return `true`. * Otherwise bump to the end of the file and return `false`.
(pattern: string)
| 1199 | * Otherwise bump to the end of the file and return `false`. |
| 1200 | */ |
| 1201 | private bumpUntil(pattern: string): boolean { |
| 1202 | const currentOffset = this.offset() |
| 1203 | const index = this.message.indexOf(pattern, currentOffset) |
| 1204 | if (index >= 0) { |
| 1205 | this.bumpTo(index) |
| 1206 | return true |
| 1207 | } else { |
| 1208 | this.bumpTo(this.message.length) |
| 1209 | return false |
| 1210 | } |
| 1211 | } |
| 1212 | |
| 1213 | /** |
| 1214 | * Bump the parser to the target offset. |
no test coverage detected