diff --git a/src/parser/ParseError.ts b/src/parser/ParseError.ts index d8165c8..d6dae6b 100644 --- a/src/parser/ParseError.ts +++ b/src/parser/ParseError.ts @@ -1,7 +1,9 @@ import { SourceLocation } from "./tokenizer"; export class ParseError 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; } }