Skip to content

Commit

Permalink
Revert "Require \r whitespace to be followed by \n"
Browse files Browse the repository at this point in the history
This reverts commit 0c550b2.
  • Loading branch information
dtolnay committed Jul 9, 2023
1 parent bdfb5c1 commit d10651c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,10 @@ fn skip_whitespace(input: Cursor) -> Cursor {
}
}
match byte {
b' ' | 0x09..=0x0c => {
b' ' | 0x09..=0x0d => {
s = s.advance(1);
continue;
}
b'\r' if s.as_bytes().get(1) == Some(&b'\n') => {
s = s.advance(2);
continue;
}
b if b <= 0x7f => {}
_ => {
let ch = s.chars().next().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ fn whitespace() {
assert_eq!(tokens.into_iter().count(), 0);

let lone_carriage_return = " \r ";
lone_carriage_return.parse::<TokenStream>().unwrap_err();
lone_carriage_return.parse::<TokenStream>().unwrap(); // FIXME
}

#[test]
Expand Down

0 comments on commit d10651c

Please sign in to comment.