(description descriptionWithComment)
| 319 | } |
| 320 | |
| 321 | func (p *parser) parseUnionTypeDefinition(description descriptionWithComment) *Definition { |
| 322 | _, comment := p.expectKeyword("union") |
| 323 | |
| 324 | var def Definition |
| 325 | def.Position = p.peekPos() |
| 326 | def.Kind = Union |
| 327 | def.BeforeDescriptionComment = description.comment |
| 328 | def.Description = description.text |
| 329 | def.AfterDescriptionComment = comment |
| 330 | def.Name = p.parseName() |
| 331 | def.Directives = p.parseDirectives(true) |
| 332 | def.Types, def.TypePositions = p.parseUnionMemberTypes() |
| 333 | return &def |
| 334 | } |
| 335 | |
| 336 | // parseUnionMemberTypes parses a union's member type list. It returns the member |
| 337 | // type names alongside their source positions; the two slices have equal length |
no test coverage detected