<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex/parse.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-04-21 09:53:04 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2023-04-21 09:53:04 +0100
commitf1e5bc37723a4faa30bbfeed392c31489914eb50 (patch)
tree3515317bfd9a509d4bef0392ec0cbf3da35d71eb /subex/parse.go
parent3cb886859e9b4df4ece183583dfd8b5ba7a59584 (diff)
downloadstred-go-f1e5bc37723a4faa30bbfeed392c31489914eb50.tar
Add subex syntax to copy across booleans, numbers, strings and values
Diffstat (limited to 'subex/parse.go')
-rw-r--r--subex/parse.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/subex/parse.go b/subex/parse.go
index 5675ae0..106663d 100644
--- a/subex/parse.go
+++ b/subex/parse.go
@@ -281,7 +281,7 @@ func parseSubex(l RuneReader, minPower int) SubexAST {
case '[':
rangeParts := parseRangeSubex(l)
lhs = SubexASTRange {rangeParts}
- case ')', '|', ';', '{', '+', '-', '*', '/', '$':
+ case ')', '|', ';', '{', '+', '-', '*', '/', '!', '$':
l.Rewind()
return nil
case '=':
@@ -289,6 +289,16 @@ func parseSubex(l RuneReader, minPower int) SubexAST {
lhs = SubexASTOutput{replacement}
case '.':
lhs = SubexASTCopyAny{}
+ case '?':
+ lhs = SubexASTCopyBool{}
+ case '%':
+ lhs = SubexASTCopyNumber{}
+ case '_':
+ lhs = SubexASTCopyStringAtom{}
+ case '#':
+ lhs = SubexASTCopyString{}
+ case ',':
+ lhs = SubexASTCopyValue{}
case '"':
lhs = SubexASTCopyAtom {walk.StringTerminal{}}
case '`':