Allow attributes on top level expression

A top level expression is either
- a expression statement or
- the last expression in a block
This commit is contained in:
pcpthm 2019-03-19 17:24:02 +09:00
parent 1cd18f9237
commit ffed132e52
8 changed files with 231 additions and 35 deletions

View file

@ -105,7 +105,9 @@ pub(super) fn process(sink: &mut dyn TreeSink, mut events: Vec<Event>) {
// append `A`'s forward_parent `B`
fp = match mem::replace(&mut events[idx], Event::tombstone()) {
Event::Start { kind, forward_parent } => {
forward_parents.push(kind);
if kind != TOMBSTONE {
forward_parents.push(kind);
}
forward_parent
}
_ => unreachable!(),