<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex/parse.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2024-03-29 17:38:33 +0000
committerCharlie Stanton <charlie@shtanton.xyz>2024-03-29 17:38:33 +0000
commitad0cde67e01a54a138acf760642d62aedbfece46 (patch)
treea0c680a93cb5042f89bb7552943fb210c4d6ae57 /subex/parse.go
parent080a24e894f125d4f1741cfdcba7cb722304d209 (diff)
downloadstred-go-ad0cde67e01a54a138acf760642d62aedbfece46.tar
Add basic array manipulation
Diffstat (limited to 'subex/parse.go')
-rw-r--r--subex/parse.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/subex/parse.go b/subex/parse.go
index fa98ecc..9602a4b 100644
--- a/subex/parse.go
+++ b/subex/parse.go
@@ -293,6 +293,18 @@ func parseSubex(l RuneReader, minPower int, inType Type, outType Type) SubexAST
panic("Missing matching ~")
}
lhs = SubexASTEnterString {lhs}
+ case '@':
+ if !accept(l, "(") {
+ panic("Missing ( after @")
+ }
+ lhs = parseSubex(l, 0, ValueType, ValueType)
+ if !accept(l, ")") {
+ panic("Missing matching )")
+ }
+ if !accept(l, "@") {
+ panic("Missing matching ~")
+ }
+ lhs = SubexASTEnterArray {lhs}
// TODO
// case '[':
// rangeParts := parseRangeSubex(l)