| 1174 | } |
| 1175 | |
| 1176 | bool isStructuredBindingVariable(const Variable* var) |
| 1177 | { |
| 1178 | if (!var || var->isArray()) |
| 1179 | return false; |
| 1180 | const Token* tok = var->nameToken(); |
| 1181 | while (tok && Token::Match(tok->astParent(), "[|,|:")) |
| 1182 | tok = tok->astParent(); |
| 1183 | return tok && (tok->str() == "[" || Token::simpleMatch(tok->previous(), "] :")); // TODO: remove workaround when #11105 is fixed |
| 1184 | } |
| 1185 | |
| 1186 | /// This takes a token that refers to a variable and it will return the token |
| 1187 | /// to the expression that the variable is assigned to. If its not valid to |
no test coverage detected