feat: error for when there is more source code than parsed

This commit is contained in:
2025-12-27 02:08:18 -05:00
parent df53409887
commit 884180de92
6 changed files with 54 additions and 13 deletions

View File

@@ -39,6 +39,15 @@ func (i Iterator[T]) Get() (T, error) {
return i.items[i.index], nil
}
func (i Iterator[T]) MustGet() T {
var null T
if i.Done() {
return null
}
return i.items[i.index]
}
// Create a new iterator, over a set of items.
func (i *Iterator[T]) Next() (T, error) {
item, err := i.Get()