def determine_start_offset(block, tokens)
      start_offset = start_token = nil
      # The start of the block should occur somewhere on line 1.
      # Check the whole line to ensure there aren't multiple blocks on the line.
      tokens.each do |token|
        # Break after line 1.
        break if token[0][0] != 1

        # Look for a left brace (`{`) or `do` keyword.
        if token[1] == :on_lbrace || (token[1] == :on_kw && token[2] == DO_STR)
          # Raise if we've already found something that looks like a block
          # start.
          raise AmbiguousSourceError.from_proc(block) if start_offset
          start_token = token[1]
          start_offset = token[0][1]
        end
      end
      raise AmbiguousSourceError.from_proc(block) unless start_offset
      [start_offset, start_token]
    end
def determine_start_offset(block, tokens)
      start_offset = start_token = nil
      # The start of the block should occur somewhere on line 1.
      # Check the whole line to ensure there aren't multiple blocks on the line.
      tokens.each do |token|
        # Break after line 1.
        break if token[0][0] != 1

        # Look for a left brace (`{`) or `do` keyword.
        if token[1] == :on_lbrace || (token[1] == :on_kw && token[2] == DO_STR)
          # Raise if we've already found something that looks like a block
          # start.
          raise AmbiguousSourceError.from_proc(block) if start_offset
          start_token = token[1]
          start_offset = token[0][1]
        end
      end
      raise AmbiguousSourceError.from_proc(block) unless start_offset
      [start_offset, start_token]
    end
The logic required to determine the starting offset of the block. The
 start of the block is characterized by the opening left curly brace (`{`)
 of the block or the `do` keyword. Everything prior to the start of the
 block is ignored because we can determine whether the block should be a
 lambda or a proc by asking the block directly, and we may not always have
 such a keyword available to us, e.g. a method that takes a block like
 TCOMethod.with_tco.