Added surrounding quotes
This commit is contained in:
parent
878cbf56ca
commit
5463ed2cdf
@ -328,8 +328,12 @@ pub fn template(i: &str) -> IResult<&str, Template> {
|
||||
Ok((remaining, Template { contents: contents }))
|
||||
}
|
||||
|
||||
fn temp_string(i: &str) -> IResult<&str, &str> {
|
||||
escaped(is_not(r#"\""#), '\\', one_of(r#"\""#))(i)
|
||||
fn quoted_string(i: &str) -> IResult<&str, &str> {
|
||||
delimited(
|
||||
tag(r#"""#),
|
||||
escaped(is_not(r#"\""#), '\\', one_of(r#"\""#)),
|
||||
tag(r#"""#),
|
||||
)(i)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@ -610,6 +614,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_temp_string() {
|
||||
assert_eq!(temp_string(r#"foo\"bar"#), Ok(("", r#"foo\"bar"#)));
|
||||
assert_eq!(quoted_string(r#""foo\"bar""#), Ok(("", r#"foo\"bar"#)));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user