Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/analysis/parsing/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,17 @@ impl TreeElement for HashIfContent {
&self.truebranch,
&self.elsebranch)
}
fn style_check(&self, acc: &mut Vec<DMLStyleError>, rules: &CurrentRules, mut aux: AuxParams) {
self.evaluate_rules(acc, rules, aux);
self.cond.style_check(acc, rules, aux);

if let Content::Some(statement::StatementContent::Compound(_))
= self.truebranch.content.as_ref() {
aux.depth -= 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work correctly when, say, true-branch is a compound but else-branch is not?

}
self.truebranch.style_check(acc, rules, aux);
self.elsebranch.style_check(acc, rules, aux);
}
}

impl Parse<StatementContent> for HashIfContent {
Expand Down
Loading