stred

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

commit e4c2e0165d349167a736e7f44a6b66bf8a4d668f
parent 52fff75dbe45611e05b68646dd26329411425158
Author: Charlie Stanton <charlie@shtanton.xyz>
Date:   Wed, 26 Apr 2023 09:24:38 +0100

Fix minor bug with a few cases where fillReadBuffer was returning the wrong structure

Diffstat:
Mwalk/read.go | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/walk/read.go b/walk/read.go @@ -266,7 +266,7 @@ func (in *JSONIn) fillReadBuffer(structure []JSONInStructure) ([]JSONInStructure value: { r, err := in.nextNonWsRune() if err != nil { - return structure, err + panic("Missing value in JSON") } switch r { case 'n': @@ -404,7 +404,7 @@ func (in *JSONIn) fillReadBuffer(structure []JSONInStructure) ([]JSONInStructure valueEnd: { r, err := in.nextNonWsRune() if err != nil { - return structure, err + return append(structure, JSONInValueEnd), err } underState := structure[len(structure) - 1] if underState == JSONInRoot {