Commit Graph
6 Commits
Author SHA1 Message Date
korvahkhandGitHub 104ca2ce22 Merge branch 'odin-lang:master' into fix-omitempty-comma 2024-06-13 01:27:44 +00:00
korvahkh a7a6ff8c69 encoding/json: Fix struct marshal() emitting comma after omitted field
Previously:
```odin
package main

import "core:fmt"
import "core:encoding/json"

T :: struct {
	a: string `json:",omitempty"`,
	b: string,
}

main :: proc() {
	data, _ := json.marshal(T{b = "foo"})
	fmt.println(string(data))
}
```
would output:
```
{,"b":"foo"}
```

which is not correct.

Also cleaned up some whitespace while I'm at it.
2024-05-27 16:59:46 -05:00
korvahkh 58ae96c821 Fix slice.has_prefix & slice.has_suffix
The needle was the element type instead of the slice type.
2024-05-25 15:52:35 -05:00
korvahkh 9b759f39fc encoding/json: Properly marshal #no_nil unions
Previously the first variant of a `#no_nil` would always be output as
`null`, and following variants would be treated as the wrong type.
2024-05-11 14:36:56 -05:00
korvahkh 8530829ca4 Fix dynamic array index = value with const value initializing to 0 2024-02-02 15:27:39 -06:00
korvahkh 759e342872 Fix #3056 2023-12-29 22:39:34 -06:00