From febdc5dcd5b25a090b90c920914775265da98d39 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Tue, 18 Apr 2023 14:04:48 +0100 Subject: Removes try, maybe, maximise and minimise These are no longer necessary and have been replaced by repeat --- subex/subexast.go | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) (limited to 'subex/subexast.go') 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 -- cgit v1.2.3