From 8e9f0b186745afd51579d2a6136a57705efc7574 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Tue, 18 Apr 2023 12:47:55 +0100 Subject: Adds the repeat construct, obsoleting maximise, minimise, try, maybe and probably more The repeat construct repeats a subex a number of times, this number is based on a provided list which is ordered by priority and can be unbounded. --- subex/subexstate.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'subex/subexstate.go') diff --git a/subex/subexstate.go b/subex/subexstate.go index 6318376..3c554a2 100644 --- a/subex/subexstate.go +++ b/subex/subexstate.go @@ -123,6 +123,15 @@ func (state SubexNoneState) accepting(store Store) [][]walk.Atom { return [][]walk.Atom{nil} } +// A dead end state, handy for making internals work nicer but technically redundant +type SubexDeadState struct {} +func (state SubexDeadState) eat(store Store, char walk.Atom) []SubexBranch { + return nil +} +func (state SubexDeadState) accepting (store Store) [][]walk.Atom { + return nil +} + // Read in a specific Atom and output it type SubexCopyAtomState struct { atom walk.Atom -- cgit v1.2.3