feat: new parser strategy

This commit is contained in:
2026-02-09 23:46:36 -05:00
parent 361f529bdc
commit 87f2370d81
12 changed files with 377 additions and 144 deletions

View File

@@ -81,10 +81,10 @@ func (i Iterator[T]) Done() bool {
return i.index == len(i.items)
}
// Do attempts to perform an operation using the iterator. If the operation
// Try attempts to perform an operation using the iterator. If the operation
// succeeds, the iterator is updated. If the operation fails, the iterator is
// rolled back, and an error is returned.
func Do[T any, U any](i *Iterator[T], fn func(i *Iterator[T]) (U, error)) (U, error) {
func Try[T any, U any](i *Iterator[T], fn func(i *Iterator[T]) (U, error)) (U, error) {
i2 := i.Copy()
out, err := fn(i2)