Example #1
0
	def _lexLine(self, line):
		isWhitespace = lambda c: c in whitespace
		hsregions = [(start,stop) for start,stop 
				in regions_satisfying(isWhitespace, line)
				if self.isHSpace(start,stop,line)]
		yield string_regions_replace(line, hsregions, 
				const(self.token))
Example #2
0
	def __init__(self, linesrc, ignore=const(False),
			isHSpace=defaultIsHSpace,
			token=hspaceTok):
		Lexer.__init__(self, linesrc, ignore)
		self.isHSpace = isHSpace
		self.token = token