5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-10 14:30:26 +00:00
matterbridge/vendor/github.com/graph-gophers/graphql-go/internal/common/directive.go
2022-04-01 00:23:19 +02:00

19 lines
411 B
Go

package common
import "github.com/graph-gophers/graphql-go/types"
func ParseDirectives(l *Lexer) types.DirectiveList {
var directives types.DirectiveList
for l.Peek() == '@' {
l.ConsumeToken('@')
d := &types.Directive{}
d.Name = l.ConsumeIdentWithLoc()
d.Name.Loc.Column--
if l.Peek() == '(' {
d.Arguments = ParseArgumentList(l)
}
directives = append(directives, d)
}
return directives
}