(description descriptionWithComment)
| 551 | } |
| 552 | |
| 553 | func (p *parser) parseDirectiveDefinition(description descriptionWithComment) *DirectiveDefinition { |
| 554 | _, comment := p.expectKeyword("directive") |
| 555 | p.expect(lexer.At) |
| 556 | |
| 557 | var def DirectiveDefinition |
| 558 | def.Position = p.peekPos() |
| 559 | def.BeforeDescriptionComment = description.comment |
| 560 | def.Description = description.text |
| 561 | def.AfterDescriptionComment = comment |
| 562 | def.Name = p.parseName() |
| 563 | def.Arguments = p.parseArgumentDefs() |
| 564 | |
| 565 | if peek := p.peek(); peek.Kind == lexer.Name && peek.Value == "repeatable" { |
| 566 | def.IsRepeatable = true |
| 567 | p.skip(lexer.Name) |
| 568 | } |
| 569 | |
| 570 | p.expectKeyword("on") |
| 571 | def.Locations = p.parseDirectiveLocations() |
| 572 | return &def |
| 573 | } |
| 574 | |
| 575 | func (p *parser) parseDirectiveLocations() []DirectiveLocation { |
| 576 | p.skip(lexer.Pipe) |
no test coverage detected