def determine_offsets(block, source)
      tokens = Ripper.lex(source)
      start_offset, start_token = determine_start_offset(block, tokens)
      expected_match = start_token == :on_kw ? :on_kw : :on_rbrace
      end_offset = determine_end_offset(block, tokens, source, expected_match)
      [start_offset, end_offset]
    end
def determine_offsets(block, source)
      tokens = Ripper.lex(source)
      start_offset, start_token = determine_start_offset(block, tokens)
      expected_match = start_token == :on_kw ? :on_kw : :on_rbrace
      end_offset = determine_end_offset(block, tokens, source, expected_match)
      [start_offset, end_offset]
    end
Tokenizes the source of the block as determined by the `method_source` gem
 and determines the beginning and end of the block.

 In both cases the entire line is checked to ensure there's no unexpected
 ambiguity as to the start or end of the block. See the test file for this
 class for examples of ambiguous situations.

 @param [Proc] block The proc for which the starting offset of its source
 code should be determined.
 @param [String] source The source code of the provided block.
 @raise [AmbiguousSourceError] Raised when the source of the block cannot
   be determined unambiguously.
 @return [Array<Integer>] The start and end offsets of the block's source
   code as 2-element Array.