fix overeager detection of (->)/2 in if position of (;)/2 (#2183)

This commit is contained in:
Mark
2023-11-29 10:51:55 -07:00
parent e8d8b09e52
commit de452bb2c2

View File

@@ -663,12 +663,16 @@ impl VariableClassifier {
state_stack.last(), state_stack.last(),
Some(TraversalState::RemoveBranchNum) Some(TraversalState::RemoveBranchNum)
) { ) {
// check if the second-to-last element is a regular BuildDisjunct, as we don't // check if the second-to-last element
// want to add GetPrevLevel in case of a TrustMe. // is a regular BuildDisjunct, as we
matches!( // don't want to add GetPrevLevel in
state_stack.iter().rev().nth(1), // case of a TrustMe.
Some(TraversalState::BuildDisjunct(..)) match state_stack.iter().rev().nth(1) {
) Some(&TraversalState::BuildDisjunct(preceding_len)) => {
preceding_len + 1 == build_stack.len()
}
_ => false,
}
} else { } else {
false false
}; };