docs: def gather(input):
  		"""Collect contiguous lines of text, preserving line numbers."""
  		
  		try:
  			line = input.next()
  		except StopIteration:
  			return
  		
  		lead = True
  		buffer = []
  		
  		# Gather contiguous (uninterrupted) lines of template text.
  		while line.kind == 'text':
  			value = line.line.rstrip().rstrip('\\') + ('' if line.continued else '\n')
  			
  			if lead and line.stripped:
  				yield Line(line.number, value)
  				lead = False
  			
  			elif not lead:
  				if line.stripped:
  					for buf in buffer:
  						yield buf
  					
  					buffer = []
  					yield Line(line.number, value)
  				
  				else:
  					buffer.append(Line(line.number, value))
  			
  			try:
  				line = input.next()
  			except StopIteration:
  				line = None
  				break
  			
  		if line:
  			input.push(line)