From 81925b6ad5212512d27365b8224b76095191431f Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Sun, 31 Mar 2024 21:23:17 +0100 Subject: Add " shorthand for string destructure --- subex/subexstate.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'subex/subexstate.go') diff --git a/subex/subexstate.go b/subex/subexstate.go index 26d7347..4f5dc19 100644 --- a/subex/subexstate.go +++ b/subex/subexstate.go @@ -424,8 +424,7 @@ type SubexIncrementNestState struct { next SubexState } func (state SubexIncrementNestState) epsilon(aux auxiliaryState) []SubexBranch { - aux.nestingLen += 1 - aux.nestingValue = state.keys + aux.nesting = append(aux.nesting, state.keys) return []SubexBranch {{ state: state.next, aux: aux, @@ -439,7 +438,7 @@ type SubexDecrementNestState struct { next SubexState } func (state SubexDecrementNestState) epsilon(aux auxiliaryState) []SubexBranch { - aux.nestingLen -= 1 + aux.nesting = aux.nesting[:len(aux.nesting) - 1] // aux.nestingValue will be set in addStates return []SubexBranch {{ state: state.next, -- cgit v1.2.3