simc-ast-builder
Version:
Parser and AST generator for SimulationCraft files
26 lines • 783 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimCVisitorError = void 0;
/**
* Error class for visitor validation errors
*/
class SimCVisitorError extends Error {
constructor(message, context) {
super(message);
this.context = context;
this.name = "SimCVisitorError";
}
// Get source location info based on the context
get location() {
return {
column: this.context.start.charPositionInLine,
line: this.context.start.line,
};
}
toString() {
const { column, line } = this.location;
return `${this.name} at ${line}:${column}: ${this.message}`;
}
}
exports.SimCVisitorError = SimCVisitorError;
//# sourceMappingURL=SimCVisitorError.js.map