Skip to content

Commit

Permalink
v1.0.1 prep
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseCoretta committed Mar 2, 2024
1 parent 44be0e9 commit 9d1c3fd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 57 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/JesseCoretta/go-stackage

go 1.20

retract [v0.0.1-alpha.0, v0.0.3-alpha.1]
retract [v0.0.1-alpha.0, v0.0.3-alpha.1 v1.0.0]
67 changes: 12 additions & 55 deletions stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -1849,42 +1849,6 @@ func (r *stack) string() (assembled string) {
return
}

/*
stringAssertion is the private method called during slice iteration
during stack.string runs.
DECOM
*/
/*
func (r stack) stringAssertion(x any) (value string) {
fname := fmname()
r.calls(sprintf("%s: in:%T(nil:%t)",
fname, x, x == nil))
switch tv := x.(type) {
case string:
// Slice is a raw string value (which
// may be eligible for encapsulation)
value = r.encapv(tv)
r.trace(sprintf("%s: assert:%T->%T(%v;len:%d)",
fname, tv, value, value, len(value)))
default:
// Catch-all; call defaultAssertionHandler
// with the current interface slice as the
// input argument (tv).
value = r.defaultAssertionHandler(tv)
r.trace(sprintf("%s: assert fallback:%T->%T(%v;len:%d)",
fname, tv, value, value, len(value)))
}
r.calls(sprintf("%s: out:%T(%v;len:%d)",
fname, value, value, len(value)))
return
}
*/

/*
defaultAssertionHandler is a private method called by stack.string.
*/
Expand Down Expand Up @@ -2118,26 +2082,21 @@ func (r *stack) reveal() (err error) {

// scan each slice (except the config
// slice) and analyze its structure.
for i := 0; i < r.len(); i++ {
for i := 0; i < r.len() && err == nil; i++ {
sl, _, _ := r.index(i) // cfg offset handled by index method, be honest
r.trace(sprintf("%s: iterate idx:%d %T::", fname, i, sl))
if sl == nil {
continue
}

// If the element is a stack, begin descent
// through recursion.
if outer, ook := stackTypeAliasConverter(sl); ook && outer.Len() > 0 {
id := getLogID(outer.getID())
r.trace(sprintf("%s: descending into idx:%d %T::%s", fname, i, outer, id))
if err = r.revealDescend(outer, i); err == nil {
continue
if sl != nil {
// If the element is a stack, begin descent
// through recursion.
if outer, ook := stackTypeAliasConverter(sl); ook && outer.Len() > 0 {
id := getLogID(outer.getID())
r.trace(sprintf("%s: descending into idx:%d %T::%s", fname, i, outer, id))
if err = r.revealDescend(outer, i); err != nil {
r.error(sprintf("%s: %T::%s %v", fname, outer, id, err))
}
}
r.setErr(err)
r.error(sprintf("%s: %T::%s %v", fname, outer, id, err))
break
r.calls(sprintf("%s: out:%T(nil:%t)", fname, err, err == nil))
}
r.calls(sprintf("%s: out:%T(nil:%t)", fname, err, err == nil))
}

return
Expand Down Expand Up @@ -2473,9 +2432,7 @@ func factorNegIndex(i, l int) int {
// 'idx' to a positive number that
// reflects the intended slice index
// value.
if i += (l * 2); i == 0 {
i++
} else if i > l-1 {
if i += (l * 2); i > l-1 {
i = (i - l) + 1
} else {
i++
Expand Down
4 changes: 3 additions & 1 deletion stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1169,10 +1169,12 @@ func TestInterface(t *testing.T) {
}

func TestStack_Reveal_experimental001(t *testing.T) {
custom := Cond(`outer`, Ne, customStack(And().Push(Cond(`keyword`, Eq, "somevalue"))))

thisIsMyNightmare := And().Push(
`this1`,
Or().Mutex().Push(
And().Push(Cond(`keyword`, Eq, "somevalue")),
custom,
And().Push(
`this4`,
Not().Mutex().Push(
Expand Down

0 comments on commit 9d1c3fd

Please sign in to comment.