Optimized single character check

This commit is contained in:
András Veres-Szentkirályi 2011-08-18 23:33:14 +02:00
parent 9abff4f0ac
commit 6f00987850

View File

@ -3402,7 +3402,7 @@ def _makeTags(tagStr, xml):
Dict(ZeroOrMore(Group( tagAttrName + Suppress("=") + tagAttrValue ))) + \ Dict(ZeroOrMore(Group( tagAttrName + Suppress("=") + tagAttrValue ))) + \
Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">") Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">")
else: else:
printablesLessRAbrack = "".join(c for c in printables if c not in ">") printablesLessRAbrack = "".join(c for c in printables if c != ">")
tagAttrValue = quotedString.copy().setParseAction( removeQuotes ) | Word(printablesLessRAbrack) tagAttrValue = quotedString.copy().setParseAction( removeQuotes ) | Word(printablesLessRAbrack)
openTag = Suppress("<") + tagStr + \ openTag = Suppress("<") + tagStr + \
Dict(ZeroOrMore(Group( tagAttrName.setParseAction(downcaseTokens) + \ Dict(ZeroOrMore(Group( tagAttrName.setParseAction(downcaseTokens) + \