Simplify comment parsing

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2023-01-08 19:52:56 +01:00
parent 8f48183e30
commit 4a1dc94a41
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -48,9 +48,7 @@ fn allspaces(i: &str) -> IResult<&str, &str> {
}
fn comment(i: &str) -> IResult<&str, &str> {
let (i, _) = tag("#")(i)?;
let (i, _) = take_until("\n")(i)?;
let (i, _) = tag("\n")(i)?;
let (i, _) = delimited(tag("#"), take_until("\n"), tag("\n"))(i)?;
Ok((i, ""))
}