mirror of
https://github.com/TxtDot/dalet-rs.git
synced 2024-12-24 17:43:46 +03:00
fix: escaping in argument and multiline text
This commit is contained in:
parent
e4eca62e38
commit
6099dbd236
2 changed files with 5 additions and 5 deletions
|
@ -86,7 +86,7 @@ fn symbol<'src>() -> impl Parser<'src, &'src str, Token<'src>, extra::Err<Rich<'
|
|||
fn argument<'src>() -> impl Parser<'src, &'src str, Token<'src>, extra::Err<Rich<'src, char, Span>>>
|
||||
{
|
||||
let arg_escape = just('\\')
|
||||
.ignore_then(just('"'))
|
||||
.ignore_then(choice((just('"'), just('\\'))))
|
||||
.labelled("Escape sequence for argument");
|
||||
|
||||
let number = text::int(10)
|
||||
|
@ -109,7 +109,7 @@ fn argument<'src>() -> impl Parser<'src, &'src str, Token<'src>, extra::Err<Rich
|
|||
fn textual<'src>() -> impl Parser<'src, &'src str, Token<'src>, extra::Err<Rich<'src, char, Span>>>
|
||||
{
|
||||
let escape = just('\\')
|
||||
.ignore_then(just('}'))
|
||||
.ignore_then(choice((just('}'), just('\\'))))
|
||||
.labelled("Multi-line escape sequence");
|
||||
|
||||
let text = none_of("\n")
|
||||
|
|
|
@ -31,9 +31,9 @@ pub fn tag<'tokens, 'src: 'tokens>(
|
|||
|
||||
let text_body = select! {
|
||||
Token::TextBody(t) => t.to_owned(),
|
||||
Token::MLText(t) => trim_indent(t).to_owned(),
|
||||
Token::MLMSText(n, t) => set_spaces(t, n).to_owned(),
|
||||
Token::MLRText(t) => t.to_owned()
|
||||
Token::MLText(t) => trim_indent(t).replace("\\}", "}").replace("\\\\", "\\"),
|
||||
Token::MLMSText(n, t) => set_spaces(t, n).replace("\\}", "}").replace("\\\\", "\\"),
|
||||
Token::MLRText(t) => t.replace("\\}", "}").replace("\\\\", "\\")
|
||||
}
|
||||
.labelled("Text body");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue