Skip to content

Commit 12c0bac

Browse files
committed
simplify some code in the tokenizer
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40260
1 parent 97d4aed commit 12c0bac

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

tokenizer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,10 @@ def consumeNumberEntity(self, isHex):
271271

272272
def consumeEntity(self):
273273
char = None
274-
charStack = []
275-
charStack.append(self.consumeChar())
274+
charStack = [self.consumeChar()]
276275
if charStack[0] == u"#":
277-
charStack.append(self.consumeChar())
278-
charStack.append(self.consumeChar())
276+
# We might have a number entity here.
277+
charStack.extend([self.consumeChar(), self.consumeChar()])
279278
if EOF in charStack:
280279
# If we reach the end of the file put everything up to EOF
281280
# back in the queue

0 commit comments

Comments
 (0)