From 75449283c2e3fd0ebfcd5594ad0b55aa895682e8 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Wed, 10 Sep 2025 08:44:06 -0400 Subject: [PATCH 1/2] Allow missing trailing comma with proc groups with odin parser --- core/odin/parser/parser.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/odin/parser/parser.odin b/core/odin/parser/parser.odin index 18dd9aa88..dab2d5d6a 100644 --- a/core/odin/parser/parser.odin +++ b/core/odin/parser/parser.odin @@ -2485,7 +2485,7 @@ parse_operand :: proc(p: ^Parser, lhs: bool) -> ^ast.Expr { allow_token(p, .Comma) or_break } - close := expect_token(p, .Close_Brace) + close := expect_closing_brace_of_field_list(p) if len(args) == 0 { error(p, tok.pos, "expected at least 1 argument in procedure group") From 9492dccb4a94cf266f05f0d7b47b5c1ce8daa272 Mon Sep 17 00:00:00 2001 From: Jacob Friedman Date: Wed, 10 Sep 2025 16:50:12 +0200 Subject: [PATCH 2/2] Fix incorrect json encoding for control characters < 32 --- core/io/util.odin | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/io/util.odin b/core/io/util.odin index 72983523a..a956a5975 100644 --- a/core/io/util.odin +++ b/core/io/util.odin @@ -189,6 +189,23 @@ write_escaped_rune :: proc(w: Writer, r: rune, quote: byte, html_safe := false, write_encoded_rune(w, r, false, &n) or_return return } + if r < 32 && for_json { + switch r { + case '\b': write_string(w, `\b`, &n) or_return + case '\f': write_string(w, `\f`, &n) or_return + case '\n': write_string(w, `\n`, &n) or_return + case '\r': write_string(w, `\r`, &n) or_return + case '\t': write_string(w, `\t`, &n) or_return + case: + write_byte(w, '\\', &n) or_return + write_byte(w, 'u', &n) or_return + write_byte(w, '0', &n) or_return + write_byte(w, '0', &n) or_return + write_byte(w, DIGITS_LOWER[r>>4 & 0xf], &n) or_return + write_byte(w, DIGITS_LOWER[r & 0xf], &n) or_return + } + return + } switch r { case '\a': write_string(w, `\a`, &n) or_return case '\b': write_string(w, `\b`, &n) or_return