diff --git a/src/parser/ValidationError.ts b/src/parser/ValidationError.ts index a872b16..fc14e31 100644 --- a/src/parser/ValidationError.ts +++ b/src/parser/ValidationError.ts @@ -1,7 +1,9 @@ import { SourceLocation } from "./tokenizer"; export class ValidationError extends Error { - constructor(msg: string, { row, col }: SourceLocation) { - super(`${msg} at line ${row + 1} char ${col + 1}`); + public loc: SourceLocation; + constructor(msg: string, loc: SourceLocation) { + super(`${msg} at line ${loc.row + 1} char ${loc.col + 1}`); + this.loc = loc; } }