Put cut around string parsing
This commit is contained in:
parent
a9afb6d24e
commit
2ba0fb4869
@ -842,7 +842,14 @@ fn bare_string_literal(input: Span) -> ParseResult<String> {
|
|||||||
alt((value("\\", tag("\\")), value("\"", tag("\"")), value("\n", tag("n")), value("\t", tag("t"))));
|
alt((value("\\", tag("\\")), value("\"", tag("\"")), value("\n", tag("n")), value("\t", tag("t"))));
|
||||||
alt((
|
alt((
|
||||||
map(tag(r#""""#), |_| String::new()),
|
map(tag(r#""""#), |_| String::new()),
|
||||||
delimited(char('"'), escaped_transform(none_of(r#""\"#), '\\', string_escape_transforms), char('"')),
|
preceded(
|
||||||
|
peek(char('"')),
|
||||||
|
cut(delimited(
|
||||||
|
char('"'),
|
||||||
|
escaped_transform(none_of(r#""\"#), '\\', string_escape_transforms),
|
||||||
|
char('"'),
|
||||||
|
)),
|
||||||
|
),
|
||||||
))(input)
|
))(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user