<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-04-20 12:31:39 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2023-04-20 12:31:39 +0100
commit3d5730276b8866c3458f163f3050fe2daea259e3 (patch)
treeaead8e45ec9aae6f8a07e68dc33b17c1740504a9 /subex
parente2774a2ca2d58d4dd507b210d4a62a23a538e833 (diff)
downloadstred-go-3d5730276b8866c3458f163f3050fe2daea259e3.tar
Change output syntax to =xyz= instead of "xyz"
This frees up " to be used for a string terminal literal
Diffstat (limited to 'subex')
-rw-r--r--subex/parse.go6
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 '.':