mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-15 08:55:04 +01:00
crates work
This commit is contained in:
parent
b3b0bc2e6f
commit
c4cfa19fa9
7 changed files with 125 additions and 49 deletions
|
|
@ -23,7 +23,11 @@ export class CompilerError extends Error {
|
|||
}
|
||||
}
|
||||
|
||||
export function withErrorPrinter(input: string, filename: string, f: () => void): void {
|
||||
export function withErrorPrinter(
|
||||
input: string,
|
||||
filename: string,
|
||||
f: () => void
|
||||
): void {
|
||||
try {
|
||||
f();
|
||||
} catch (e) {
|
||||
|
|
@ -50,7 +54,6 @@ function renderError(input: string, filename: string, e: CompilerError) {
|
|||
const lineNo = lineIdx + 1;
|
||||
console.error(`error: ${e.message}`);
|
||||
console.error(` --> ${filename}:${lineNo}`);
|
||||
|
||||
|
||||
console.error(`${lineNo} | ${spanToSnippet(input, line)}`);
|
||||
const startRelLine =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue