(scanner: Scanner, message: string)
| 836 | } |
| 837 | |
| 838 | function createParseErrorMessage(scanner: Scanner, message: string) { |
| 839 | const string = scanner.source.slice(0, scanner.position); |
| 840 | const lines = string.split("\n"); |
| 841 | const row = lines.length; |
| 842 | const column = lines.at(-1)?.length ?? 0; |
| 843 | return `Parse error on line ${row}, column ${column}: ${message}`; |
| 844 | } |
| 845 | |
| 846 | export function parserFactory<T>(parser: ParserComponent<T>) { |
| 847 | return (tomlString: string): T => { |
no test coverage detected