ocat-lang
Version:
A programming language for the web design and development
29 lines (28 loc) • 854 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.OSyntaxError = exports.CustomError = void 0;
const types_1 = require("./types");
const derr_1 = __importDefault(require("./derr"));
class CustomError {
constructor(message, type) {
this.message = message;
this.type = type;
}
display(line) {
(0, derr_1.default)(() => {
console.log(`CustomError at line ${line}:
'${this.message}'
of type ${this.type}`);
});
}
}
exports.CustomError = CustomError;
class OSyntaxError extends CustomError {
constructor(message) {
super(message, types_1.ErrorType.SyntaxError);
}
}
exports.OSyntaxError = OSyntaxError;