<- Back to shtanton's homepage
summaryrefslogtreecommitdiff
path: root/main/subexast.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2022-12-24 10:04:42 +0000
committerCharlie Stanton <charlie@shtanton.xyz>2022-12-24 10:04:42 +0000
commitb2d1d965dee8cc2c1e063067d53a3c8e28a46d6c (patch)
tree1319884f055b2c64cf1787936c1b4b580d40dcff /main/subexast.go
parentce2db2bc333ed938ec93d5ad0838f8cb720c4865 (diff)
downloadsubex-main.tar
Adds the character range mapping syntaxHEADmain
Ranges of characters can be mapped with [] For example, capitalisation of a letter: [a-z=A-Z] Caesar cipher shift of 1: [a-zA-Z=b-zaB-ZA]
Diffstat (limited to 'main/subexast.go')
-rw-r--r--main/subexast.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/main/subexast.go b/main/subexast.go
index 040bc9d..aabdcd0 100644
--- a/main/subexast.go
+++ b/main/subexast.go
@@ -151,3 +151,13 @@ func (ast SubexASTJoin) compileWith(next SubexState) SubexState {
next,
}
}
+
+type SubexASTRange struct {
+ parts map[rune]rune
+}
+func (ast SubexASTRange) compileWith(next SubexState) SubexState {
+ return &SubexRangeState {
+ parts: ast.parts,
+ next: next,
+ }
+}