Parser inputs #
Iterators for common parser inputs, with HasPos instances for error reporting:
CharIteratoriterates over the characters of aString.Slice. UnlikeString.Slice.chars, its type does not depend on the slice, so parsers can name it.ByteIteratoriterates over the bytes of aByteArray.BitIteratoriterates over the bits of aBitVec, least significant bit first.- Core's
ArrayIterator(fromArray.iter) reports its index as the position.
Iterator over the characters of a String.Slice.
- slice : String.Slice
The slice being iterated over.
The current position in
slice.
Instances For
Positions are byte offsets into the slice.
Iterator over the characters of s.
Instances For
The remaining characters as a slice.
Instances For
Positions are byte indices.
Positions are bit indices.
Positions are array indices.
Running parsers #
captureSlice p parses p and returns its result together with the slice of input that p
consumed. The slice is a view into the input; no characters are copied.
Instances For
Run p on the characters of s.
Instances For
Run p on the characters of s.
Instances For
Run p on the bytes of data.
Instances For
Run p on the bits of bits, least significant bit first.
Instances For
Run p on the elements of xs.
Instances For
Run p on the elements of xs. Vectors use the array iterator.
Instances For
Run p on the elements of xs. Lists have no HasPos instance.