Switch attributes
| 196 | // Switch attributes |
| 197 | // |
| 198 | void TParseContext::handleSwitchAttributes(const TAttributes& attributes, TIntermNode* node) |
| 199 | { |
| 200 | TIntermSwitch* selection = node->getAsSwitchNode(); |
| 201 | if (selection == nullptr) |
| 202 | return; |
| 203 | |
| 204 | for (auto it = attributes.begin(); it != attributes.end(); ++it) { |
| 205 | if (it->size() > 0) { |
| 206 | warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", ""); |
| 207 | continue; |
| 208 | } |
| 209 | |
| 210 | switch (it->name) { |
| 211 | case EatFlatten: |
| 212 | selection->setFlatten(); |
| 213 | break; |
| 214 | case EatBranch: |
| 215 | selection->setDontFlatten(); |
| 216 | break; |
| 217 | default: |
| 218 | warn(node->getLoc(), "attribute does not apply to a switch", "", ""); |
| 219 | break; |
| 220 | } |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | // |
| 225 | // Loop attributes |
no test coverage detected