| 2627 | } |
| 2628 | |
| 2629 | static const Token * getSingleExpressionInBlock(const Token * tok) |
| 2630 | { |
| 2631 | if (!tok) |
| 2632 | return nullptr; |
| 2633 | const Token * top = tok->astTop(); |
| 2634 | const Token * nextExpression = nextAfterAstRightmostLeaf(top); |
| 2635 | if (!Token::simpleMatch(nextExpression, "; }")) |
| 2636 | return nullptr; |
| 2637 | return top; |
| 2638 | } |
| 2639 | |
| 2640 | //----------------------------------------------------------------------------- |
| 2641 | // check for duplicate code in if and else branches |
no test coverage detected