Method: SyntaxTree::CHAR#copy

Defined in:
lib/syntax_tree/node.rb

#copy(value: nil, location: nil) ⇒ Object



269
270
271
272
273
274
275
276
277
278
# File 'lib/syntax_tree/node.rb', line 269

def copy(value: nil, location: nil)
  node =
    CHAR.new(
      value: value || self.value,
      location: location || self.location
    )

  node.comments.concat(comments.map(&:copy))
  node
end