better recovery for exprs

This commit is contained in:
Aleksey Kladov 2018-08-28 11:12:42 +03:00
parent 13110f48e9
commit 2fa90e736b
16 changed files with 263 additions and 27 deletions

View file

@ -115,6 +115,15 @@ impl<'a> Module<'a> {
}
}
impl<'a> LetStmt<'a> {
pub fn has_semi(self) -> bool {
match self.syntax().last_child() {
None => false,
Some(node) => node.kind() == SEMI,
}
}
}
impl<'a> IfExpr<'a> {
pub fn then_branch(self) -> Option<Block<'a>> {
self.blocks().nth(0)