* If the substring starting at the current position of the parser has * the given prefix, then bump the parser to the character immediately * following the prefix and return true. Otherwise, don't bump the parser * and return false.
(prefix: string)
| 1185 | * and return false. |
| 1186 | */ |
| 1187 | private bumpIf(prefix: string): boolean { |
| 1188 | if (this.message.startsWith(prefix, this.offset())) { |
| 1189 | for (let i = 0; i < prefix.length; i++) { |
| 1190 | this.bump() |
| 1191 | } |
| 1192 | return true |
| 1193 | } |
| 1194 | return false |
| 1195 | } |
| 1196 | |
| 1197 | /** |
| 1198 | * Bump the parser until the pattern character is found and return `true`. |
no test coverage detected