123456789_123456789_123456789_123456789_123456789_

Class: Prism::Node

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#newline_flag?Boolean (readonly)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/prism/parse_result/newlines.rb', line 65

def newline_flag? # :nodoc:
  @newline_flag ? true : false
end

Instance Method Details

#deprecated(*replacements)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/prism/node_ext.rb', line 7

def deprecated(*replacements) # :nodoc:
  location = caller_locations(1, 1)
  location = location[0].label if location
  suggest = replacements.map { |replacement| "#{self.class}##{replacement}" }

  warn(<<~MSG, category: :deprecated)
    [deprecation]: #{self.class}##{location} is deprecated and will be \
    removed in the next major version. Use #{suggest.join("/")} instead.
    #{(caller(1, 3) || []).join("\n")}
  MSG
end

#newline_flag!(lines)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/prism/parse_result/newlines.rb', line 69

def newline_flag!(lines) # :nodoc:
  line = location.start_line
  unless lines[line]
    lines[line] = true
    @newline_flag = true
  end
end