diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2023-04-20 12:31:39 +0100 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2023-04-20 12:31:39 +0100 |
commit | 3d5730276b8866c3458f163f3050fe2daea259e3 (patch) | |
tree | aead8e45ec9aae6f8a07e68dc33b17c1740504a9 | |
parent | e2774a2ca2d58d4dd507b210d4a62a23a538e833 (diff) | |
download | stred-go-3d5730276b8866c3458f163f3050fe2daea259e3.tar |
Change output syntax to =xyz= instead of "xyz"
This frees up " to be used for a string terminal literal
-rw-r--r-- | subex/parse.go | 6 |
1 files changed, 3 insertions, 3 deletions
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 '.': |