refactor: query diagnostic message table directly
This commit is contained in:
+6
-1
@@ -1,5 +1,6 @@
|
||||
import "@std/mem"
|
||||
import "@std/arraylist"
|
||||
import "@std/enummap"
|
||||
import "@std/io"
|
||||
import "@std/process"
|
||||
|
||||
@@ -182,7 +183,11 @@ report_diagnostics proc(
|
||||
if (id == diagnostics.DiagnosticId(index)) label = "runtime trap"
|
||||
}
|
||||
try io.print("{s}:{}:{}: {s}: {s}\n", output, {
|
||||
path, line + 1, offset - starts.items[line] + 1, label, diagnostics.message(diagnostic.code),
|
||||
path,
|
||||
line + 1,
|
||||
offset - starts.items[line] + 1,
|
||||
label,
|
||||
enummap.get(diagnostics.Code, []u8, &diagnostics.messages, diagnostic.code)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user