Problem
SourceIterator::consume panics via expect if asked to consume past the available input. The call sites appear to rely on a lookahead invariant, but that invariant is undocumented and not encoded in the API.
Desired outcome
Either document and assert the invariant clearly, or return an internal error instead of panicking.
Location
ndc_lexer/src/lib.rs, SourceIterator::consume.
Problem
SourceIterator::consumepanics viaexpectif asked to consume past the available input. The call sites appear to rely on a lookahead invariant, but that invariant is undocumented and not encoded in the API.Desired outcome
Either document and assert the invariant clearly, or return an internal error instead of panicking.
Location
ndc_lexer/src/lib.rs,SourceIterator::consume.