Function combine::parser::char::newline

source ·
pub fn newline<Input>() -> impl Parser<Input, Output = char, PartialState = ()>
where Input: Stream<Token = char>,
Expand description

Parses a newline character ('\n').

use combine::Parser;
use combine::parser::char::newline;
assert_eq!(newline().parse("\n"), Ok(('\n', "")));
assert!(newline().parse("\r").is_err());