preprocess -> section

This commit is contained in:
PedroEdiaz
2025-06-19 00:35:42 -06:00
parent f9f4f5d34a
commit 65c6a901d2
2 changed files with 2 additions and 4 deletions

View File

@@ -86,9 +86,7 @@ decode_string :: proc( v: any, key: string ) -> string {
return fmt.tprintf("%v", decode(v, key)) return fmt.tprintf("%v", decode(v, key))
} }
preprocess :: proc( r: ^strings.Reader, v: any, key: string ) -> string { section :: proc( r: ^strings.Reader, v: any, key: string ) -> string {
if v == nil do return ""
save := r.i save := r.i
t := reflect.any_base(decode(v, key)) t := reflect.any_base(decode(v, key))

View File

@@ -81,7 +81,7 @@ mustache_reader :: proc(r: ^strings.Reader, v: any, end_block: string ) -> strin
return strings.to_string(b) return strings.to_string(b)
} }
case '#': case '#':
strings.write_string(&b, preprocess(r, v, skey[1:]) ) strings.write_string(&b, section(r, v, skey[1:]) )
case: case:
strings.write_string(&b, decode_string(v, skey) ) strings.write_string(&b, decode_string(v, skey) )
} }