@scalenc/nc-format
Version:
Library for handling TRUMPF NC file format.
25 lines • 801 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParserException = void 0;
class ParserException extends Error {
parser;
constructor(parser, message) {
super(`ERROR in line ${parser.line}: ${message.replace(/\{0\}/g, parser.token?.value ?? '')}`);
this.parser = parser;
}
static assert(condition, parser, message) {
if (!condition) {
ParserException.fail(parser, message);
}
}
static expected(condition, parser, message) {
if (!condition) {
ParserException.fail(parser, message);
}
}
static fail(parser, message) {
throw new ParserException(parser, message);
}
}
exports.ParserException = ParserException;
//# sourceMappingURL=ParserException.js.map