mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-25 06:21:36 +00:00
19 lines
411 B
Go
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
|
|
}
|