debugging inline comment bug

This commit is contained in:
Anton-4 2021-12-01 16:57:28 +01:00
parent 30c1d218a7
commit 5bd776f972
17 changed files with 206 additions and 30 deletions

View file

@ -321,6 +321,15 @@ impl<'a> CommentOrNewline<'a> {
DocComment(_) => false,
}
}
pub fn to_string(&self) -> std::string::String {
use CommentOrNewline::*;
match self {
Newline => "\n".to_owned(),
LineComment(comment_str) => format!("#{}",comment_str),
DocComment(comment_str) => format!("##{}",comment_str),
}
}
}
#[derive(Clone, Copy, Debug, PartialEq)]

View file

@ -1580,7 +1580,7 @@ pub fn defs<'a>(min_indent: u16) -> impl Parser<'a, Vec<'a, Located<Def<'a>>>, E
.alloc(def.value)
.with_spaces_after(final_space, def.region)
}
dbg!(def);
output.push(def);
}
}

View file

@ -1147,7 +1147,10 @@ macro_rules! skip_second {
match $p1.parse(arena, state) {
Ok((p1, out1, state)) => match $p2.parse(arena, state) {
Ok((p2, _, state)) => Ok((p1.or(p2), out1, state)),
Ok((p2, _, state)) => {
dbg!(&out1);
Ok((p1.or(p2), out1, state))
},
Err((p2, fail, _)) => Err((p1.or(p2), fail, original_state)),
},
Err((progress, fail, _)) => Err((progress, fail, original_state)),

View file

@ -34,7 +34,10 @@ pub fn parse_defs_with<'a>(
let state = State::new(input.trim().as_bytes());
match module_defs().parse(arena, state) {
Ok(tuple) => Ok(tuple.1),
Ok(tuple) => {
dbg!(&tuple);
Ok(tuple.1)
},
Err(tuple) => Err(tuple.1),
}
}