Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Prism::Translation::Parser::Compiler#srange_find

srange_find(start_offset, end_offset, character)

Constructs a new source range by finding the given character between the given start offset and end offset. If the needle is not found, it returns nil. Importantly it does not search past newlines or comments.

Note that end_offset is allowed to be nil, in which case this will search until the end of the string.