| 159 | } |
| 160 | |
| 161 | void AstNode::reverseExpr() |
| 162 | { |
| 163 | AstNode *parent = this; |
| 164 | AstNode *backup = this->getChild(1); |
| 165 | if (parent->getChild(0)->getToken().getToken() == TOK_ARRAY) |
| 166 | { |
| 167 | while (parent->getChild(0)->getToken().getToken() == TOK_ARRAY) |
| 168 | { |
| 169 | AstNode *parentExpr = parent->getChild(1); |
| 170 | AstNode *childExpr = parent->getChild(0)->getChild(1); |
| 171 | parent->replaceChild(parentExpr, childExpr); |
| 172 | parent = parent->getChild(0); |
| 173 | } |
| 174 | parent->replaceChild(parent->getChild(1), backup); |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | void AstNode::replaceChild(AstNode *original, AstNode *replacement) |
| 179 | { |
nothing calls this directly
no test coverage detected