class

Obelisk::SafeTokenIteratorAdapter

Inherits Iterator < Enumerable < Reference < Object

Safe adapter to work around Crystal bug #14317 with RegexTokenIterator This pre-fetches tokens to avoid memory corruption when iterating TODO: Replace with lazy streaming when Crystal type system allows

Constructors

new(lexer : Lexer, text : String)
Source

Instance methods

next

Returns the next element in this iterator, or Iterator::Stop::INSTANCE if there are no more elements.

Source