stred

Stred: Streaming Tree Editor. Like sed but for JSON
git clone http://shtanton.xyz/git/repo/stred
Log | Files | Refs

commit 3fe10dc8f2d00287b10e9689449764dfb3eba3af
parent 8a9d6ef5970eea2a42ff9eb537f2a3f5e56aec2c
Author: Charlie Stanton <charlie@shtanton.xyz>
Date:   Wed, 19 Apr 2023 17:02:37 +0100

Adds casting all other types to strings by simply putting them in a string

Diffstat:
Mwalk/walk.go | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/walk/walk.go b/walk/walk.go @@ -529,6 +529,14 @@ func Compound(in <-chan Atom) <-chan CompoundResult { break loop case StringAtom: builder.WriteRune(rune(v)) + case ValueNull: + builder.WriteString(v.String()) + case ValueBool: + builder.WriteString(v.String()) + case ValueNumber: + builder.WriteString(v.String()) + case TerminalValue: + builder.WriteString(v.String()) default: out<-CompoundResult{nil, CompoundInvalidStringAtom} break outer