diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2023-04-18 14:04:48 +0100 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2023-04-18 14:04:48 +0100 |
commit | febdc5dcd5b25a090b90c920914775265da98d39 (patch) | |
tree | f55e57e6c65dd9fa4bfc9844d2365f52b350aaf0 /subex/subexast.go | |
parent | 8e9f0b186745afd51579d2a6136a57705efc7574 (diff) | |
download | stred-go-febdc5dcd5b25a090b90c920914775265da98d39.tar |
Removes try, maybe, maximise and minimise
These are no longer necessary and have been replaced by repeat
Diffstat (limited to 'subex/subexast.go')
-rw-r--r-- | subex/subexast.go | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/subex/subexast.go b/subex/subexast.go index 650f038..5e63f03 100644 --- a/subex/subexast.go +++ b/subex/subexast.go @@ -48,38 +48,6 @@ func (ast SubexASTOr) compileWith(next SubexState) SubexState { } } -// Run the content subex as many times as possible as the input is read in -type SubexASTMaximise struct { - content SubexAST -} -func (ast SubexASTMaximise) compileWith(next SubexState) SubexState { - state := &SubexGroupState { - nil, - next, - } - state.first = ast.content.compileWith(state) - return state -} -func (ast SubexASTMaximise) String() string { - return fmt.Sprintf("(%v)*", ast.content) -} - -// Run the content subex as few times as possible as the input is read in -type SubexASTMinimise struct { - content SubexAST -} -func (ast SubexASTMinimise) compileWith(next SubexState) SubexState { - state := &SubexGroupState { - next, - nil, - } - state.second = ast.content.compileWith(state) - return state -} -func (ast SubexASTMinimise) String() string { - return fmt.Sprintf("(%v)-", ast.content) -} - type ConvexRange struct { start, end int } @@ -185,28 +153,6 @@ func (ast SubexASTOutput) compileWith(next SubexState) SubexState { } } -// Try to use a subex but just skip over this if it doesn't match -type SubexASTTry struct { - content SubexAST -} -func (ast SubexASTTry) compileWith(next SubexState) SubexState { - return &SubexGroupState { - ast.content.compileWith(next), - next, - } -} - -// Try to skip over this subex but use it should that not match -type SubexASTMaybe struct { - content SubexAST -} -func (ast SubexASTMaybe) compileWith(next SubexState) SubexState { - return &SubexGroupState { - next, - ast.content.compileWith(next), - } -} - // Read in a repeated subex separated by a delimiter. Greedy type SubexASTJoin struct { content, delimiter SubexAST |