difftreelog
fix in comments, eof should be allowed in place of eol
in: master
1 file changed
crates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth30 grammar jsonnet_parser() for str {30 grammar jsonnet_parser() for str {31 use peg::ParseLiteral;31 use peg::ParseLiteral;3233 rule eof() = quiet!{![_]} / expected!("<eof>")34 rule eol() = "\n" / eof()323533 /// Standard C-like comments36 /// Standard C-like comments34 rule comment()37 rule comment()35 = "//" (!['\n'][_])* "\n"38 = "//" (!eol()[_])* eol()36 / "/*" ("\\*/" / "\\\\" / (!("*/")[_]))* "*/"39 / "/*" ("\\*/" / "\\\\" / (!("*/")[_]))* "*/"37 / "#" (!['\n'][_])* "\n"40 / "#" (!eol()[_])* eol()384139 rule single_whitespace() = quiet!{([' ' | '\r' | '\n' | '\t'] / comment())} / expected!("<whitespace>")42 rule single_whitespace() = quiet!{([' ' | '\r' | '\n' | '\t'] / comment())} / expected!("<whitespace>")40 rule _() = single_whitespace()*43 rule _() = single_whitespace()*561 // ^^^^ failed code564 // ^^^^ failed code562 }565 }566567 #[test]568 fn missing_newline_between_comment_and_eof() {569 parse!(570 "{a:1}571572 //+213"573 );574 }563575564 #[test]576 #[test]565 fn default_param_before_nondefault() {577 fn default_param_before_nondefault() {