This commit is contained in:
nora 2023-07-23 14:02:53 +02:00
parent 91b183c002
commit 4e95bc05a3
9 changed files with 640 additions and 132 deletions

View file

@ -3,6 +3,13 @@ export type Span = {
end: number;
};
export function spanMerge(a: Span, b: Span): Span {
return {
start: Math.min(a.start, b.start),
end: Math.max(a.end, b.end),
};
}
export class CompilerError extends Error {
msg: string;
span: Span;