stred

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

commit 3d5730276b8866c3458f163f3050fe2daea259e3
parent e2774a2ca2d58d4dd507b210d4a62a23a538e833
Author: Charlie Stanton <charlie@shtanton.xyz>
Date:   Thu, 20 Apr 2023 12:31:39 +0100

Change output syntax to =xyz= instead of "xyz"

This frees up " to be used for a string terminal literal

Diffstat:
Msubex/parse.go | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/subex/parse.go b/subex/parse.go @@ -178,7 +178,7 @@ func parseReplacement(l RuneReader) (output []OutputContent) { switch r { case eof: panic("Missing closing \"") - case '"': + case '=': break loop case '$': slot := l.Next() @@ -299,10 +299,10 @@ func parseSubex(l RuneReader, minPower int) SubexAST { case '[': rangeParts := parseRangeSubex(l) lhs = SubexASTRange {rangeParts} - case ')', '|', ';', '{', '+', '$': + case ')', '|', ';', '{', '+', '-', '*', '/', '$': l.Rewind() return nil - case '"': + case '=': replacement := parseReplacement(l) lhs = SubexASTOutput{replacement} case '.':