Selection attributes
| 167 | // Selection attributes |
| 168 | // |
| 169 | void TParseContext::handleSelectionAttributes(const TAttributes& attributes, TIntermNode* node) |
| 170 | { |
| 171 | TIntermSelection* selection = node->getAsSelectionNode(); |
| 172 | if (selection == nullptr) |
| 173 | return; |
| 174 | |
| 175 | for (auto it = attributes.begin(); it != attributes.end(); ++it) { |
| 176 | if (it->size() > 0) { |
| 177 | warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", ""); |
| 178 | continue; |
| 179 | } |
| 180 | |
| 181 | switch (it->name) { |
| 182 | case EatFlatten: |
| 183 | selection->setFlatten(); |
| 184 | break; |
| 185 | case EatBranch: |
| 186 | selection->setDontFlatten(); |
| 187 | break; |
| 188 | default: |
| 189 | warn(node->getLoc(), "attribute does not apply to a selection", "", ""); |
| 190 | break; |
| 191 | } |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | // |
| 196 | // Switch attributes |
no test coverage detected