| 264 | } |
| 265 | |
| 266 | StructDecl parseStruct() { |
| 267 | StructDecl decl; |
| 268 | decl.line = token_.line; |
| 269 | decl.name = expect(Tok::Ident, "struct name").text; |
| 270 | expect(Tok::LBrace); |
| 271 | std::unordered_set<std::string> names; |
| 272 | while (token_.kind != Tok::RBrace) { |
| 273 | Field field = parseField(false); |
| 274 | ensureUnique(names, field.name, "struct field", field.line); |
| 275 | expect(Tok::Semi); |
| 276 | decl.fields.push_back(std::move(field)); |
| 277 | } |
| 278 | expect(Tok::RBrace); |
| 279 | optionalSemi(); |
| 280 | return decl; |
| 281 | } |
| 282 | |
| 283 | ProtocolDecl parseProtocol() { |
| 284 | ProtocolDecl decl; |
nothing calls this directly
no outgoing calls
no test coverage detected