Skip to content

Commit

Permalink
Allow block definitions in if/for/match blocks (fixes #335)
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Jun 2, 2020
1 parent 17ec9e4 commit 67f345b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions askama_shared/src/heritage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ impl<'a> Context<'a> {
nested.push(nodes);
}
}
Node::Cond(branches, _) => {
for (_, _, nodes) in branches {
nested.push(nodes);
}
}
Node::Loop(_, _, _, nodes, _) => {
nested.push(nodes);
}
Node::Match(_, _, _, arms, _) => {
for (_, _, _, arm) in arms {
nested.push(arm);
}
}
_ => {}
}
}
Expand Down

0 comments on commit 67f345b

Please sign in to comment.