# Path: cinje/util.py
# class Lines(object):
# 	"""Iterate input lines of source, with the ability to push lines back."""
# 	
# 	__slots__ = ['Line', 'source', 'buffer']
# 	
# 	def __init__(self, input=None, Line=Line):
# 		self.Line = Line
# 		
# 		if input is None:
# 			self.source = None
# 			self.buffer = deque()
# 		
# 		elif hasattr(input, 'readlines'):
# 			self.source = list(self.Line(i + 1, j) for i, j in enumerate(input.readlines()))
# 			self.buffer = deque(self.source)
# 		
# 		else:
# 			self.source = list(self.Line(i + 1, j) for i, j in enumerate(input.split('\n')))
# 			self.buffer = deque(self.source)
# 		
# 		super(Lines, self).__init__()
# 	
# 	@property
# 	def count(self):
# 		return len(self.buffer)
# 	
# 	def __len__(self):
# 		return self.count
# 	
# 	def __repr__(self):
# 		return 'Lines({0.count})'.format(self)
# 	
# 	def __iter__(self):
# 		return self
# 	
# 	def __next__(self):
# 		return self.next()
# 	
# 	def __str__(self):
# 		return "\n".join(str(i) for i in self)
# 	
# 	def next(self):
# 		if not self.buffer:
# 			raise StopIteration()
# 		
# 		return self.buffer.popleft()
# 	
# 	def peek(self):
# 		return self.buffer[0] if self.buffer else None
# 	
# 	def push(self, *lines):
# 		self.buffer.extendleft((i if isinstance(i, self.Line) else self.Line(self.buffer[0].number if self.buffer else 0, i)) for i in reversed(lines))
# 	
# 	def reset(self):
# 		self.buffer = deque(self.source)
# 	
# 	def append(self, *lines):
# 		self.buffer.extend((i if isinstance(i, self.Line) else self.Line(self.buffer[-1].number if self.buffer else 0, i)) for i in lines)


from cinje.util import Lines
# encoding: utf-8



class TestLines(object):
	"""Lines is mostly a pass-through to the underlying buffer deque.
	
	We group these tests together.
	"""
	
	@property
	def example(self):

# Path: cinje/util.py
# class Lines(object):
# 	"""Iterate input lines of source, with the ability to push lines back."""
# 	
# 	__slots__ = ['Line', 'source', 'buffer']
# 	
# 	def __init__(self, input=None, Line=Line):
# 		self.Line = Line
# 		
# 		if input is None:
# 			self.source = None
# 			self.buffer = deque()
# 		
# 		elif hasattr(input, 'readlines'):
# 			self.source = list(self.Line(i + 1, j) for i, j in enumerate(input.readlines()))
# 			self.buffer = deque(self.source)
# 		
# 		else:
# 			self.source = list(self.Line(i + 1, j) for i, j in enumerate(input.split('\n')))
# 			self.buffer = deque(self.source)
# 		
# 		super(Lines, self).__init__()
# 	
# 	@property
# 	def count(self):
# 		return len(self.buffer)
# 	
# 	def __len__(self):
# 		return self.count
# 	
# 	def __repr__(self):
# 		return 'Lines({0.count})'.format(self)
# 	
# 	def __iter__(self):
# 		return self
# 	
# 	def __next__(self):
# 		return self.next()
# 	
# 	def __str__(self):
# 		return "\n".join(str(i) for i in self)
# 	
# 	def next(self):
# 		if not self.buffer:
# 			raise StopIteration()
# 		
# 		return self.buffer.popleft()
# 	
# 	def peek(self):
# 		return self.buffer[0] if self.buffer else None
# 	
# 	def push(self, *lines):
# 		self.buffer.extendleft((i if isinstance(i, self.Line) else self.Line(self.buffer[0].number if self.buffer else 0, i)) for i in reversed(lines))
# 	
# 	def reset(self):
# 		self.buffer = deque(self.source)
# 	
# 	def append(self, *lines):
# 		self.buffer.extend((i if isinstance(i, self.Line) else self.Line(self.buffer[-1].number if self.buffer else 0, i)) for i in lines)


# Path: test/test_util/test_lines.py
from cinje.util import Lines

# encoding: utf-8



class TestLines(object):
	"""Lines is mostly a pass-through to the underlying buffer deque.
	
	We group these tests together.
	"""
	
	@property
	def example(self):

		return Lines("text\nmore text\nreplacement ${text}\n: code\n\n# comment\n")