Skip to content

Commit

Permalink
Update take_till parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
sthiele committed Dec 5, 2023
1 parent 717471f commit 7730072
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use winnow::{
ascii::{multispace0, multispace1},
combinator::{alt, eof, opt},
error::ParserError,
token::take_till0,
token::take_till,
PResult, Parser,
};

Expand All @@ -22,7 +22,7 @@ pub fn space_or_comment1<'a, E: ParserError<&'a str>>(input: &mut &'a str) -> PR
fn comment<'a, E: ParserError<&'a str>>(input: &mut &'a str) -> PResult<&'a str, E> {
multispace0.parse_next(input)?;
'%'.parse_next(input)?;
let string = take_till0(|c| c == '\n').parse_next(input)?;
let string = take_till(0.., |c| c == '\n').parse_next(input)?;
multispace0.parse_next(input)?;
opt(comment).parse_next(input)?;
Ok(string)
Expand Down
4 changes: 2 additions & 2 deletions src/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use winnow::{
ascii::multispace1,
combinator::{alt, delimited, fold_repeat, opt, preceded, repeat, separated},
error::{FromExternalError, ParserError},
token::{take_till1, take_while},
token::{take_till, take_while},
PResult, Parser,
};

Expand Down Expand Up @@ -200,7 +200,7 @@ fn parse_escaped_whitespace<'a, E: ParserError<&'a str>>(
fn parse_literal<'a, E: ParserError<&'a str>>(
input: &mut &'a str,
) -> PResult<StringFragment<'a>, E> {
let c = take_till1(['\"', '\\']).parse_next(input)?;
let c = take_till(1.., ['\"', '\\']).parse_next(input)?;
Ok(StringFragment::Literal(c))
}

Expand Down

0 comments on commit 7730072

Please sign in to comment.