xmltok: Yield attibute name and value at the same time.

pull/46/head
Paul Sokolovsky 2015-10-10 13:10:11 +03:00
rodzic cdfe726ab6
commit 1c63b95740
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -73,14 +73,15 @@ class XMLTokenizer:
def lex_attrs_till(self):
while self.isident():
attr = self.getnsident()
yield (ATTR, attr)
#yield (ATTR, attr)
self.expect("=")
self.expect('"')
val = ""
while self.curch() != '"':
val += self.getch()
yield (ATTR_VAL, val)
#yield (ATTR_VAL, val)
self.expect('"')
yield (ATTR, attr, val)
def tokenize(self):
while not self.eof():