MCPcopy Create free account
hub / github.com/denoland/std / createParseErrorMessage

Function createParseErrorMessage

toml/_parser.ts:838–844  ·  view source on GitHub ↗
(scanner: Scanner, message: string)

Source from the content-addressed store, hash-verified

836}
837
838function 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
846export function parserFactory<T>(parser: ParserComponent<T>) {
847 return (tomlString: string): T => {

Callers 1

parserFactoryFunction · 0.85

Calls 2

sliceMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected