From 16dc79fc5c98228471ed57eb0f8e853de739f6d9 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 8 Apr 2024 13:36:23 +0100 Subject: Add `"type"` field to `-json-errors` --- src/error.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/error.cpp') diff --git a/src/error.cpp b/src/error.cpp index c92392dce..eb167d4c3 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -667,6 +667,14 @@ gb_internal void print_all_errors(void) { gb_fprintf(f, "\t\t{\n"); + gb_fprintf(f, "\t\t\t\"type\": \""); + if (ev.kind == ErrorValue_Warning) { + gb_fprintf(f, "warning"); + } else { + gb_fprintf(f, "error"); + } + gb_fprintf(f, "\",\n"); + gb_fprintf(f, "\t\t\t\"pos\": {\n"); if (ev.pos.file_id) { -- cgit v1.2.3