class RuboCop::AST::ProcessedSource

def sorted_tokens

heredoc contents' tokens.
is passed as a method argument. In this case tokens are interleaved by
The tokens list is always sorted by token position, except for cases when heredoc
def sorted_tokens
  # Use stable sort.
  @sorted_tokens ||= tokens.sort_by.with_index { |token, i| [token.begin_pos, i] }
end