From 3d5730276b8866c3458f163f3050fe2daea259e3 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Thu, 20 Apr 2023 12:31:39 +0100 Subject: Change output syntax to =xyz= instead of "xyz" This frees up " to be used for a string terminal literal --- subex/parse.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'subex') diff --git a/subex/parse.go b/subex/parse.go index f95fd9f..9e47e0b 100644 --- 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 '.': -- cgit v1.2.3