diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2022-12-24 10:04:42 +0000 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2022-12-24 10:04:42 +0000 |
commit | b2d1d965dee8cc2c1e063067d53a3c8e28a46d6c (patch) | |
tree | 1319884f055b2c64cf1787936c1b4b580d40dcff /main/subexast.go | |
parent | ce2db2bc333ed938ec93d5ad0838f8cb720c4865 (diff) | |
download | subex-main.tar |
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.go | 10 |
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, + } +} |