diff options
| author | gingerBill <bill@gingerbill.org> | 2022-06-11 01:40:58 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-06-11 01:40:58 +0100 |
| commit | c166b6a21d019f4e4087ba1331a2c21fb90eb026 (patch) | |
| tree | dca27440286f0d2dfedb6e38a3d9844c21888daa | |
| parent | 6ed5cbee12d45b6085a3b7e6f7c4bbd8fbce8f27 (diff) | |
Support optional length parameter on struct tags for multi-pointers
| -rw-r--r-- | core/fmt/fmt.odin | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 4772ffb71..2a2875247 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -1709,6 +1709,11 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) { elem := runtime.type_info_base(info.elem) if elem != nil { + if n, ok := fi.optional_len.?; ok { + fmt_array(fi, ptr, n, elem.size, elem, verb) + return + } + #partial switch e in elem.variant { case runtime.Type_Info_Array, runtime.Type_Info_Slice, |