difftreelog
fix remove comment escaping syntax
in: master
1 file changed
crates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth40 /// Standard C-like comments40 /// Standard C-like comments41 rule comment()41 rule comment()42 = "//" (!eol()[_])* eol()42 = "//" (!eol()[_])* eol()43 / "/*" ("\\*/" / "\\\\" / (!("*/")[_]))* "*/"43 / "/*" (!("*/")[_])* "*/"44 / "#" (!eol()[_])* eol()44 / "#" (!eol()[_])* eol()454546 rule single_whitespace() = quiet!{([' ' | '\r' | '\n' | '\t'] / comment())} / expected!("<whitespace>")46 rule single_whitespace() = quiet!{([' ' | '\r' | '\n' | '\t'] / comment())} / expected!("<whitespace>")597 );597 );598 }598 }599600 /// Comments should be able to be escaped601 #[test]602 fn comment_escaping() {603 assert_eq!(604 parse!("2/*\\*/+*/ - 22"),605 el!(606 Expr::BinaryOp(el!(Expr::Num(2.0), 0, 1), Sub, el!(Expr::Num(22.0), 12, 14)),607 0,608 14609 )610 );611 }612599613 #[test]600 #[test]614 fn suffix() {601 fn suffix() {