| 74 | } |
| 75 | |
| 76 | void StructRejects::AddReject(std::string* r, bool g) |
| 77 | { |
| 78 | if (r == nullptr) |
| 79 | yyerror("Reject is null!"); |
| 80 | if (r->empty()) |
| 81 | yyerror("Reject is invalid!"); |
| 82 | |
| 83 | // Check for duplicates |
| 84 | auto it = std::find_if(rejects.begin(), rejects.end(), [r](auto item)->bool { return *item.reject.get() == *r; }); |
| 85 | if (it != rejects.end()) |
| 86 | yyerror("Duplicate reject " + *r); |
| 87 | |
| 88 | rejects.push_back({ std::shared_ptr<std::string>(r), g }); |
| 89 | } |
| 90 | |
| 91 | int StructType::stype = 0; |
| 92 |