pub fn position<I>() -> Position<I>where
I: Stream,
Expand description
Parser which just returns the current position in the stream.
let result = (position(), token('!'), position())
.parse(State::new("!"))
.map(|x| x.0);
assert_eq!(result, Ok((SourcePosition { line: 1, column: 1 },
'!',
SourcePosition { line: 1, column: 2 })));