Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Ruby::Prism::Location.new
new(source, start_offset, length)
lib/ruby/prism/parse_result.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/ruby/prism/parse_result.rb, line 416
def initialize(source, start_offset, length)
@source = source
@start_offset = start_offset
@length = length
# These are used to store comments that are associated with this location.
# They are initialized to `nil` to save on memory when there are no
# comments to be attached and/or the comment-related APIs are not used.
@leading_comments = nil
@trailing_comments = nil
end
Create a new location object with the given source, start byte offset, and byte length.
: (Source source, Integer start_offset, Integer length) -> void