From 65c6a901d25cfaf43e9d12a6d20a928d301e5345 Mon Sep 17 00:00:00 2001 From: PedroEdiaz Date: Thu, 19 Jun 2025 00:35:42 -0600 Subject: [PATCH] preprocess -> section --- decode.odin | 4 +--- mustache.odin | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/decode.odin b/decode.odin index 201047a..69d1ebb 100644 --- a/decode.odin +++ b/decode.odin @@ -86,9 +86,7 @@ decode_string :: proc( v: any, key: string ) -> string { return fmt.tprintf("%v", decode(v, key)) } -preprocess :: proc( r: ^strings.Reader, v: any, key: string ) -> string { - if v == nil do return "" - +section :: proc( r: ^strings.Reader, v: any, key: string ) -> string { save := r.i t := reflect.any_base(decode(v, key)) diff --git a/mustache.odin b/mustache.odin index 2c6e73d..36a4176 100644 --- a/mustache.odin +++ b/mustache.odin @@ -81,7 +81,7 @@ mustache_reader :: proc(r: ^strings.Reader, v: any, end_block: string ) -> strin return strings.to_string(b) } case '#': - strings.write_string(&b, preprocess(r, v, skey[1:]) ) + strings.write_string(&b, section(r, v, skey[1:]) ) case: strings.write_string(&b, decode_string(v, skey) ) }