Fixed comment parsing bug.
[?]
Jun 16, 2021, 12:23 PM
JUK3ONMUIR5CVOMELN6JGTUH7N2F3CRWTPI2BH747IXR3BJIYJDQCDependencies
- [2]
POIIOD4LImproved broken comment error message. - [3]
6ZJX2OQVFirst commit - [4]
VDFODD2FAdded line to BadIndent error.
Change contents
- edit in src/parser.rs at line 325
- edit in src/parser.rs at line 327
(PS::COK, Char::ForwardSlash) => {parse_state = PS::CM;}, - replacement in src/parser.rs at line 362
Line::new(line),Line::new(line + 1), - edit in src/parser.rs at line 417[3.15101]→[3.15101:15213](∅→∅),[3.15213]→[3.2085:2187](∅→∅),[3.2187]→[2.97:193](∅→∅),[2.193]→[3.2237:2287](∅→∅),[3.2237]→[3.2237:2287](∅→∅),[3.2287]→[3.15315:15334](∅→∅),[3.15315]→[3.15315:15334](∅→∅)
(PS::COK, Char::ForwardSlash) => {let token_str = &s[start_key..=pos - 1];return Err(Error::new(ErrorKind::IncompleteCommentOrKey(token_str.to_string(),Line::new(line),)));}, - replacement in src/error.rs at line 330
"\"/\" is an incomplete comment or key","\"/\" at line 2 is an incomplete comment or key.", - edit in src/error.rs at line 332
}#[test]fn indented_comment_parses() {assert!(KeyTree::parse("key:\n // comment").is_ok()); - edit in src/error.rs at line 338
#[test]fn non_indented_comment_parses() {assert!(KeyTree::parse("key:\n// comment").is_ok());} - replacement in src/error.rs at line 360
"\"/\" is an incomplete comment or key","\"/\" at line 1 is an incomplete comment or key.",