From dba7d449c8f497970178ce2aca8fcda1e0fa8495 Mon Sep 17 00:00:00 2001 From: Nathan West Date: Tue, 7 Jan 2020 17:03:27 -0500 Subject: [PATCH] Added comment to string parser --- examples/string.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/string.rs b/examples/string.rs index 113366d..3007ad6 100644 --- a/examples/string.rs +++ b/examples/string.rs @@ -147,6 +147,10 @@ fn parse_string<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, }, ); + // Finally, parse the string. Note that, if `build_string` could accept a raw + // " character, the closing delimiter " would never match. When using + // `delimited` with a looping parser (like fold_many0), be sure that the + // loop won't accidentally match your closing delimiter! delimited(char('"'), build_string, char('"'))(input) }