(scanner: Scanner)
| 589 | |
| 590 | const BOOLEAN_REGEXP = /(?:true|false)\b/y; |
| 591 | export function boolean(scanner: Scanner): ParseResult<boolean> { |
| 592 | scanner.skipWhitespaces(); |
| 593 | const match = scanner.match(BOOLEAN_REGEXP); |
| 594 | if (!match) return failure(); |
| 595 | const string = match[0]; |
| 596 | scanner.next(string.length); |
| 597 | const value = string === "true"; |
| 598 | return success(value); |
| 599 | } |
| 600 | |
| 601 | const INFINITY_MAP = new Map<string, number>([ |
| 602 | ["inf", Infinity], |
nothing calls this directly
no test coverage detected