Skip to content

Commit

Permalink
Merge pull request #1141 from ruby/remove-pattern-matching-pinning
Browse files Browse the repository at this point in the history
Remove pattern matching pinning to enable support for <= Ruby 3.0
  • Loading branch information
jemmaissroff authored Jul 14, 2023
2 parents 62d771d + b792c58 commit a8904e0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/yarp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def pretty_print(q)
end

def ==(other)
other in Location[start_offset: ^(start_offset), end_offset: ^(end_offset)]
other.is_a?(Location) &&
other.start_offset == start_offset &&
other.end_offset == end_offset
end

def self.null
Expand Down Expand Up @@ -195,7 +197,9 @@ def pretty_print(q)
end

def ==(other)
other in Token[type: ^(type), value: ^(value)]
other.is_a?(Token) &&
other.type == type &&
other.value == value
end
end

Expand Down

0 comments on commit a8904e0

Please sign in to comment.