* @param {RegExp} regExp reg exp to collect characters * @returns {string | undefined} characters
(regExp)
| 7424 | * @returns {string | undefined} characters |
| 7425 | */ |
| 7426 | function collectCharacters(regExp) { |
| 7427 | /** @type {string} */ |
| 7428 | let chars; |
| 7429 | const match = regExp.exec(input.slice(Math.max(0, position))); |
| 7430 | |
| 7431 | if (match) { |
| 7432 | [chars] = match; |
| 7433 | position += chars.length; |
| 7434 | |
| 7435 | return chars; |
| 7436 | } |
| 7437 | } |
| 7438 | |
| 7439 | /** |
| 7440 | * @returns {void} |
no test coverage detected