- From: Sean B. Palmer <sean@mysterylights.com>
- Date: Fri, 16 Aug 2002 00:05:16 +0100
- To: "Dan Connolly" <connolly@w3.org>
- Cc: <www-archive@w3.org>
class Scanner(_Scanner): def __init__(self, patterns, ignore, input): _Scanner.__init__(self, patterns, ignore, input) self.preProcess() def preProcess(self): B_LIT = r'"""[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""' A_LIT = r'"[^"\\]*(?:\\.[^"\\]*)*"' Token = re.compile(r'(%s|%s|<[^>]*>|\.\s*}|[^\s#]+)' % (B_LIT, A_LIT)) self.input = ' '.join([re.sub(r'^\.\s*}$', '}', token) for token in Token.findall(self.input)]) For yappsrt.py--class Scanner needs to be renamed _Scanner. -- Kindest Regards, Sean B. Palmer @prefix : <http://purl.org/net/swn#> . :Sean :homepage <http://purl.org/net/sbp/> .
Received on Thursday, 15 August 2002 19:05:31 UTC