code: def tokenize_block(iterable, token_types):
      
      lines = FileWrapper(iterable)
      parse_buffer = ParseBuffer()
      line = lines.peek()
      while line is not None:
          for token_type in token_types:
              if token_type.start(line):
                  result = token_type.read(lines)
                  if result is not None:
                      parse_buffer.append((token_type, result))
                      break
          else:  # unmatched newlines
              next(lines)
              parse_buffer.loose = True
          line = lines.peek()
      return parse_buffer
docs: Returns a list of pairs (token_type, read_result).
  
      Footnotes are parsed here, but span-level parsing has not
      started yet.