preprocess -> section
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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) )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user