Skip to content

Commit

Permalink
Try skipping some method calls?
Browse files Browse the repository at this point in the history
  • Loading branch information
rmosolgo committed Dec 1, 2023
1 parent e53e59c commit cdcc7b5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/graphql/language/recursive_descent_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ def operation_type
def selection_set
expect_token(:LCURLY)
selections = []
while !at?(:RCURLY)
while @token_name != :RCURLY
selections << if at?(:ELLIPSIS)
expect_token(:ELLIPSIS)
advance_token
case token_name
when :ON, :DIR_SIGN, :LCURLY
loc = pos
Expand Down Expand Up @@ -189,19 +189,19 @@ def selection_set
loc = pos
name = self.name

aliaz = nil
field_alias = nil

if at?(:COLON)
expect_token(:COLON)
aliaz = name
advance_token
field_alias = name
name = self.name
end

arguments = parse_arguments
directives = parse_directives
selection_set = if at?(:LCURLY); self.selection_set; end
arguments = at?(:LPAREN) ? parse_arguments : nil
directives = at?(:DIR_SIGN) ? parse_directives : nil
selection_set = at?(:LCURLY) ? self.selection_set : nil

Nodes::Field.new(pos: loc, alias: aliaz, name: name, arguments: arguments, directives: directives, selections: selection_set)
Nodes::Field.new(pos: loc, alias: field_alias, name: name, arguments: arguments, directives: directives, selections: selection_set)
end
end
expect_token(:RCURLY)
Expand Down

0 comments on commit cdcc7b5

Please sign in to comment.