stred

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

commit 58d50737702adc48604f0a709080dcc587d7145f
parent aea1a08d6a9d378137d467d3e1f1ccc40232b725
Author: Charlie Stanton <charlie@shtanton.xyz>
Date:   Wed, 19 Apr 2023 13:47:09 +0100

Fixes internal error messages for arithmetic functions

Diffstat:
Msubex/arithmetic.go | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/subex/arithmetic.go b/subex/arithmetic.go @@ -73,10 +73,10 @@ func multiplyValues(atoms []walk.Atom) ([]walk.Atom, error) { if err == nil { product *= num } else { - return nil, errors.New("Tried to sum non-castable string") + return nil, errors.New("Tried to multiply non-castable string") } default: - return nil, errors.New("Tried to sum non-number") + return nil, errors.New("Tried to multiply non-number") } } if allBools { @@ -110,10 +110,10 @@ func negateValues(atoms []walk.Atom) ([]walk.Atom, error) { if err == nil { negatedNumbers = append(negatedNumbers, walk.ValueNumber(-num)) } else { - return nil, errors.New("Tried to sum non-castable string") + return nil, errors.New("Tried to negate non-castable string") } default: - return nil, errors.New("Tried to sum non-number") + return nil, errors.New("Tried to negate non-number") } } return negatedNumbers, nil