pears/input

The Input(i) type holds the tokens a parser hasn’t consumed yet, e.g. the remaining input returned by pears.parse.

Types

The tokens that are yet to be consumed by a parser, along with the number of tokens consumed so far.

pub opaque type Input(i)

Values

pub fn at_end(input: Input(a)) -> Bool

Returns true if the input has been fully consumed.

pub fn position(input: Input(i)) -> Int

Returns the number of tokens consumed so far.

pub fn tokens(input: Input(i)) -> List(i)

Returns the tokens that haven’t been consumed yet.

✨ Search Document