|
|
|
@ -1,12 +1,13 @@
|
|
|
|
/* This file is generated by scripts/process-messages/index.js. Do not edit! */
|
|
|
|
/* This file is generated by scripts/process-messages/index.js. Do not edit! */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import * as state from './state.js';
|
|
|
|
|
|
|
|
|
|
|
|
/** @typedef {{ start?: number, end?: number }} NodeLike */
|
|
|
|
/** @typedef {{ start?: number, end?: number }} NodeLike */
|
|
|
|
// interface is duplicated between here (used internally) and ./interfaces.js
|
|
|
|
// interface is duplicated between here (used internally) and ./interfaces.js
|
|
|
|
// (exposed publicly), and I'm not sure how to avoid that
|
|
|
|
// (exposed publicly), and I'm not sure how to avoid that
|
|
|
|
export class CompileError extends Error {
|
|
|
|
export class CompileError extends Error {
|
|
|
|
name = 'CompileError';
|
|
|
|
name = 'CompileError';
|
|
|
|
/** @type {import('#compiler').CompileError['filename']} */
|
|
|
|
filename = state.filename;
|
|
|
|
filename = undefined;
|
|
|
|
|
|
|
|
/** @type {import('#compiler').CompileError['position']} */
|
|
|
|
/** @type {import('#compiler').CompileError['position']} */
|
|
|
|
position = undefined;
|
|
|
|
position = undefined;
|
|
|
|
/** @type {import('#compiler').CompileError['start']} */
|
|
|
|
/** @type {import('#compiler').CompileError['start']} */
|
|
|
|
@ -24,6 +25,11 @@ export class CompileError extends Error {
|
|
|
|
super(message);
|
|
|
|
super(message);
|
|
|
|
this.code = code;
|
|
|
|
this.code = code;
|
|
|
|
this.position = position;
|
|
|
|
this.position = position;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (position) {
|
|
|
|
|
|
|
|
this.start = state.locator(position[0]);
|
|
|
|
|
|
|
|
this.end = state.locator(position[1]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
toString() {
|
|
|
|
toString() {
|
|
|
|
|