class SyntaxTree::RegexpLiteral

def copy(beginning: nil, ending: nil, parts: nil, location: nil)

def copy(beginning: nil, ending: nil, parts: nil, location: nil)
  node =
    RegexpLiteral.new(
      beginning: beginning || self.beginning,
      ending: ending || self.ending,
      parts: parts || self.parts,
      location: location || self.location
    )
  node.comments.concat(comments.map(&:copy))
  node
end