pub fn position<Input>() -> Position<Input> where
    Input: Stream
Expand description

Parser which just returns the current position in the stream.

let result = (position(), token('!'), position())
    .parse(position::Stream::new("!"))
    .map(|x| x.0);
assert_eq!(result, Ok((SourcePosition { line: 1, column: 1 },
                       '!',
                       SourcePosition { line: 1, column: 2 })));