kopia lustrzana https://github.com/micropython/micropython-lib
xmltok: Get rid of string concatenation in a loop.
rodzic
e6a6503193
commit
8e19a487c5
|
@ -1,5 +1,3 @@
|
||||||
import string
|
|
||||||
|
|
||||||
TEXT = "TEXT"
|
TEXT = "TEXT"
|
||||||
START_TAG = "START_TAG"
|
START_TAG = "START_TAG"
|
||||||
#START_TAG_DONE = "START_TAG_DONE"
|
#START_TAG_DONE = "START_TAG_DONE"
|
||||||
|
@ -46,7 +44,10 @@ class XMLTokenizer:
|
||||||
def getident(self):
|
def getident(self):
|
||||||
self.skip_ws()
|
self.skip_ws()
|
||||||
ident = ""
|
ident = ""
|
||||||
while self.curch() in (string.ascii_letters + string.digits):
|
while True:
|
||||||
|
c = self.curch()
|
||||||
|
if not(c.isalpha() or c.isdigit() or c in "_-."):
|
||||||
|
break
|
||||||
ident += self.getch()
|
ident += self.getch()
|
||||||
return ident
|
return ident
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue