| 535 | } |
| 536 | |
| 537 | fn raw_string<'a>() -> impl Parser<'a, ParserInput<'a>, Literal, ParserError<'a>> { |
| 538 | just("r") |
| 539 | .then(choice((just('\''), just('"')))) |
| 540 | .then( |
| 541 | any() |
| 542 | .filter(move |c: &char| *c != '\'' && *c != '"' && *c != '\n' && *c != '\r') |
| 543 | .repeated() |
| 544 | .to_slice(), |
| 545 | ) |
| 546 | .then(choice((just('\''), just('"')))) |
| 547 | .map( |
| 548 | |(((_, _open_quote), s), _close_quote): (((&str, char), &str), char)| { |
| 549 | Literal::RawString(s.to_string()) |
| 550 | }, |
| 551 | ) |
| 552 | } |
| 553 | |
| 554 | fn boolean<'a>() -> impl Parser<'a, ParserInput<'a>, Literal, ParserError<'a>> { |
| 555 | choice((just("true").to(true), just("false").to(false))) |