Lines Matching full:data
69 yield {"type": tokenTypes["ParseError"], "data": self.stream.errors.pop(0)}
100 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
106 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
125 "data":
139 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
171 "data": "expected-numeric-entity"})
198 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
211 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
217 self.currentToken["data"][-1][1] += output
223 self.tokenQueue.append({"type": tokenTypes[tokenType], "data": output})
232 the state to "data" because that's what's needed after a token has been
241 if token["data"]:
243 "data": "attributes-in-end-tag"})
246 "data": "self-closing-flag-on-end-tag"})
252 data = self.stream.char()
253 if data == "&":
255 elif data == "<":
257 elif data == "\u0000":
259 "data": "invalid-codepoint"})
261 "data": "\u0000"})
262 elif data is EOF:
265 elif data in spaceCharacters:
266 # Directly after emitting a token you switch back to the "data
269 self.tokenQueue.append({"type": tokenTypes["SpaceCharacters"], "data":
270 data + self.stream.charsUntil(spaceCharacters, True)})
276 self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
277 data + chars})
286 data = self.stream.char()
287 if data == "&":
289 elif data == "<":
291 elif data == EOF:
294 elif data == "\u0000":
296 "data": "invalid-codepoint"})
298 "data": "\uFFFD"})
299 elif data in spaceCharacters:
300 # Directly after emitting a token you switch back to the "data
303 self.tokenQueue.append({"type": tokenTypes["SpaceCharacters"], "data":
304 data + self.stream.charsUntil(spaceCharacters, True)})
310 self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
311 data + chars})
320 data = self.stream.char()
321 if data == "<":
323 elif data == "\u0000":
325 "data": "invalid-codepoint"})
327 "data": "\uFFFD"})
328 elif data == EOF:
333 self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
334 data + chars})
338 data = self.stream.char()
339 if data == "<":
341 elif data == "\u0000":
343 "data": "invalid-codepoint"})
345 "data": "\uFFFD"})
346 elif data == EOF:
351 self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
352 data + chars})
356 data = self.stream.char()
357 if data == EOF:
360 elif data == "\u0000":
362 "data": "invalid-codepoint"})
364 "data": "\uFFFD"})
366 self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
367 data + self.stream.charsUntil("\u0000")})
371 data = self.stream.char()
372 if data == "!":
374 elif data == "/":
376 elif data in asciiLetters:
378 "name": data, "data": [],
382 elif data == ">":
385 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
387 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<>"})
389 elif data == "?":
392 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
394 self.stream.unget(data)
398 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
400 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
401 self.stream.unget(data)
406 data = self.stream.char()
407 if data in asciiLetters:
408 self.currentToken = {"type": tokenTypes["EndTag"], "name": data,
409 "data": [], "selfClosing": False}
411 elif data == ">":
412 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
415 elif data is EOF:
416 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
418 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "</"})
421 # XXX data can be _'_...
422 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
424 "datavars": {"data": data}})
425 self.stream.unget(data)
430 data = self.stream.char()
431 if data in spaceCharacters:
433 elif data == ">":
435 elif data is EOF:
436 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
439 elif data == "/":
441 elif data == "\u0000":
443 "data": "invalid-codepoint"})
446 self.currentToken["name"] += data
452 data = self.stream.char()
453 if data == "/":
457 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
458 self.stream.unget(data)
463 data = self.stream.char()
464 if data in asciiLetters:
465 self.temporaryBuffer += data
468 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "</"})
469 self.stream.unget(data)
475 data = self.stream.char()
476 if data in spaceCharacters and appropriate:
479 "data": [], "selfClosing": False}
481 elif data == "/" and appropriate:
484 "data": [], "selfClosing": False}
486 elif data == ">" and appropriate:
489 "data": [], "selfClosing": False}
492 elif data in asciiLetters:
493 self.temporaryBuffer += data
496 "data": "</" + self.temporaryBuffer})
497 self.stream.unget(data)
502 data = self.stream.char()
503 if data == "/":
507 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
508 self.stream.unget(data)
513 data = self.stream.char()
514 if data in asciiLetters:
515 self.temporaryBuffer += data
518 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "</"})
519 self.stream.unget(data)
525 data = self.stream.char()
526 if data in spaceCharacters and appropriate:
529 "data": [], "selfClosing": False}
531 elif data == "/" and appropriate:
534 "data": [], "selfClosing": False}
536 elif data == ">" and appropriate:
539 "data": [], "selfClosing": False}
542 elif data in asciiLetters:
543 self.temporaryBuffer += data
546 "data": "</" + self.temporaryBuffer})
547 self.stream.unget(data)
552 data = self.stream.char()
553 if data == "/":
556 elif data == "!":
557 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<!"})
560 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
561 self.stream.unget(data)
566 data = self.stream.char()
567 if data in asciiLetters:
568 self.temporaryBuffer += data
571 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "</"})
572 self.stream.unget(data)
578 data = self.stream.char()
579 if data in spaceCharacters and appropriate:
582 "data": [], "selfClosing": False}
584 elif data == "/" and appropriate:
587 "data": [], "selfClosing": False}
589 elif data == ">" and appropriate:
592 "data": [], "selfClosing": False}
595 elif data in asciiLetters:
596 self.temporaryBuffer += data
599 "data": "</" + self.temporaryBuffer})
600 self.stream.unget(data)
605 data = self.stream.char()
606 if data == "-":
607 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
610 self.stream.unget(data)
615 data = self.stream.char()
616 if data == "-":
617 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
620 self.stream.unget(data)
625 data = self.stream.char()
626 if data == "-":
627 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
629 elif data == "<":
631 elif data == "\u0000":
633 "data": "invalid-codepoint"})
635 "data": "\uFFFD"})
636 elif data == EOF:
640 self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
641 data + chars})
645 data = self.stream.char()
646 if data == "-":
647 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
649 elif data == "<":
651 elif data == "\u0000":
653 "data": "invalid-codepoint"})
655 "data": "\uFFFD"})
657 elif data == EOF:
660 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
665 data = self.stream.char()
666 if data == "-":
667 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
668 elif data == "<":
670 elif data == ">":
671 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": ">"})
673 elif data == "\u0000":
675 "data": "invalid-codepoint"})
677 "data": "\uFFFD"})
679 elif data == EOF:
682 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
687 data = self.stream.char()
688 if data == "/":
691 elif data in asciiLetters:
692 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<" + data})
693 self.temporaryBuffer = data
696 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
697 self.stream.unget(data)
702 data = self.stream.char()
703 if data in asciiLetters:
704 self.temporaryBuffer = data
707 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "</"})
708 self.stream.unget(data)
714 data = self.stream.char()
715 if data in spaceCharacters and appropriate:
718 "data": [], "selfClosing": False}
720 elif data == "/" and appropriate:
723 "data": [], "selfClosing": False}
725 elif data == ">" and appropriate:
728 "data": [], "selfClosing": False}
731 elif data in asciiLetters:
732 self.temporaryBuffer += data
735 "data": "</" + self.temporaryBuffer})
736 self.stream.unget(data)
741 data = self.stream.char()
742 if data in (spaceCharacters | frozenset(("/", ">"))):
743 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
748 elif data in asciiLetters:
749 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
750 self.temporaryBuffer += data
752 self.stream.unget(data)
757 data = self.stream.char()
758 if data == "-":
759 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
761 elif data == "<":
762 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
764 elif data == "\u0000":
766 "data": "invalid-codepoint"})
768 "data": "\uFFFD"})
769 elif data == EOF:
770 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
774 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
778 data = self.stream.char()
779 if data == "-":
780 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
782 elif data == "<":
783 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
785 elif data == "\u0000":
787 "data": "invalid-codepoint"})
789 "data": "\uFFFD"})
791 elif data == EOF:
792 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
796 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
801 data = self.stream.char()
802 if data == "-":
803 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
804 elif data == "<":
805 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
807 elif data == ">":
808 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": ">"})
810 elif data == "\u0000":
812 "data": "invalid-codepoint"})
814 "data": "\uFFFD"})
816 elif data == EOF:
817 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
821 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
826 data = self.stream.char()
827 if data == "/":
828 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "/"})
832 self.stream.unget(data)
837 data = self.stream.char()
838 if data in (spaceCharacters | frozenset(("/", ">"))):
839 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
844 elif data in asciiLetters:
845 self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
846 self.temporaryBuffer += data
848 self.stream.unget(data)
853 data = self.stream.char()
854 if data in spaceCharacters:
856 elif data in asciiLetters:
857 self.currentToken["data"].append([data, ""])
859 elif data == ">":
861 elif data == "/":
863 elif data in ("'", '"', "=", "<"):
864 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
866 self.currentToken["data"].append([data, ""])
868 elif data == "\u0000":
870 "data": "invalid-codepoint"})
871 self.currentToken["data"].append(["\uFFFD", ""])
873 elif data is EOF:
874 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
878 self.currentToken["data"].append([data, ""])
883 data = self.stream.char()
886 if data == "=":
888 elif data in asciiLetters:
889 self.currentToken["data"][-1][0] += data +\
892 elif data == ">":
895 # because data is a dict not a list
897 elif data in spaceCharacters:
899 elif data == "/":
901 elif data == "\u0000":
903 "data": "invalid-codepoint"})
904 self.currentToken["data"][-1][0] += "\uFFFD"
906 elif data in ("'", '"', "<"):
908 "data":
910 self.currentToken["data"][-1][0] += data
912 elif data is EOF:
914 "data": "eof-in-attribute-name"})
917 self.currentToken["data"][-1][0] += data
925 self.currentToken["data"][-1][0] = (
926 self.currentToken["data"][-1][0].translate(asciiUpper2Lower))
927 for name, value in self.currentToken["data"][:-1]:
928 if self.currentToken["data"][-1][0] == name:
929 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
938 data = self.stream.char()
939 if data in spaceCharacters:
941 elif data == "=":
943 elif data == ">":
945 elif data in asciiLetters:
946 self.currentToken["data"].append([data, ""])
948 elif data == "/":
950 elif data == "\u0000":
952 "data": "invalid-codepoint"})
953 self.currentToken["data"].append(["\uFFFD", ""])
955 elif data in ("'", '"', "<"):
956 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
958 self.currentToken["data"].append([data, ""])
960 elif data is EOF:
961 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
965 self.currentToken["data"].append([data, ""])
970 data = self.stream.char()
971 if data in spaceCharacters:
973 elif data == "\"":
975 elif data == "&":
977 self.stream.unget(data)
978 elif data == "'":
980 elif data == ">":
981 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
984 elif data == "\u0000":
986 "data": "invalid-codepoint"})
987 self.currentToken["data"][-1][1] += "\uFFFD"
989 elif data in ("=", "<", "`"):
990 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
992 self.currentToken["data"][-1][1] += data
994 elif data is EOF:
995 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
999 self.currentToken["data"][-1][1] += data
1004 data = self.stream.char()
1005 if data == "\"":
1007 elif data == "&":
1009 elif data == "\u0000":
1011 "data": "invalid-codepoint"})
1012 self.currentToken["data"][-1][1] += "\uFFFD"
1013 elif data is EOF:
1014 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1018 self.currentToken["data"][-1][1] += data +\
1023 data = self.stream.char()
1024 if data == "'":
1026 elif data == "&":
1028 elif data == "\u0000":
1030 "data": "invalid-codepoint"})
1031 self.currentToken["data"][-1][1] += "\uFFFD"
1032 elif data is EOF:
1033 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1037 self.currentToken["data"][-1][1] += data +\
1042 data = self.stream.char()
1043 if data in spaceCharacters:
1045 elif data == "&":
1047 elif data == ">":
1049 elif data in ('"', "'", "=", "<", "`"):
1050 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1052 self.currentToken["data"][-1][1] += data
1053 elif data == "\u0000":
1055 "data": "invalid-codepoint"})
1056 self.currentToken["data"][-1][1] += "\uFFFD"
1057 elif data is EOF:
1058 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1062 self.currentToken["data"][-1][1] += data + self.stream.charsUntil(
1067 data = self.stream.char()
1068 if data in spaceCharacters:
1070 elif data == ">":
1072 elif data == "/":
1074 elif data is EOF:
1075 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1077 self.stream.unget(data)
1080 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1082 self.stream.unget(data)
1087 data = self.stream.char()
1088 if data == ">":
1091 elif data is EOF:
1093 "data":
1095 self.stream.unget(data)
1098 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1100 self.stream.unget(data)
1108 data = self.stream.charsUntil(">")
1109 data = data.replace("\u0000", "\uFFFD")
1111 {"type": tokenTypes["Comment"], "data": data})
1124 self.currentToken = {"type": tokenTypes["Comment"], "data": ""}
1156 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1165 data = self.stream.char()
1166 if data == "-":
1168 elif data == "\u0000":
1170 "data": "invalid-codepoint"})
1171 self.currentToken["data"] += "\uFFFD"
1172 elif data == ">":
1173 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1177 elif data is EOF:
1178 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1183 self.currentToken["data"] += data
1188 data = self.stream.char()
1189 if data == "-":
1191 elif data == "\u0000":
1193 "data": "invalid-codepoint"})
1194 self.currentToken["data"] += "-\uFFFD"
1195 elif data == ">":
1196 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1200 elif data is EOF:
1201 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1206 self.currentToken["data"] += "-" + data
1211 data = self.stream.char()
1212 if data == "-":
1214 elif data == "\u0000":
1216 "data": "invalid-codepoint"})
1217 self.currentToken["data"] += "\uFFFD"
1218 elif data is EOF:
1220 "data": "eof-in-comment"})
1224 self.currentToken["data"] += data + \
1229 data = self.stream.char()
1230 if data == "-":
1232 elif data == "\u0000":
1234 "data": "invalid-codepoint"})
1235 self.currentToken["data"] += "-\uFFFD"
1237 elif data is EOF:
1238 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1243 self.currentToken["data"] += "-" + data
1248 data = self.stream.char()
1249 if data == ">":
1252 elif data == "\u0000":
1254 "data": "invalid-codepoint"})
1255 self.currentToken["data"] += "--\uFFFD"
1257 elif data == "!":
1258 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1261 elif data == "-":
1262 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1264 self.currentToken["data"] += data
1265 elif data is EOF:
1266 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1272 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1274 self.currentToken["data"] += "--" + data
1279 data = self.stream.char()
1280 if data == ">":
1283 elif data == "-":
1284 self.currentToken["data"] += "--!"
1286 elif data == "\u0000":
1288 "data": "invalid-codepoint"})
1289 self.currentToken["data"] += "--!\uFFFD"
1291 elif data is EOF:
1292 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1297 self.currentToken["data"] += "--!" + data
1302 data = self.stream.char()
1303 if data in spaceCharacters:
1305 elif data is EOF:
1306 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1312 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1314 self.stream.unget(data)
1319 data = self.stream.char()
1320 if data in spaceCharacters:
1322 elif data == ">":
1323 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1328 elif data == "\u0000":
1330 "data": "invalid-codepoint"})
1333 elif data is EOF:
1334 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1340 self.currentToken["name"] = data
1345 data = self.stream.char()
1346 if data in spaceCharacters:
1349 elif data == ">":
1353 elif data == "\u0000":
1355 "data": "invalid-codepoint"})
1358 elif data is EOF:
1359 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1366 self.currentToken["name"] += data
1370 data = self.stream.char()
1371 if data in spaceCharacters:
1373 elif data == ">":
1376 elif data is EOF:
1378 self.stream.unget(data)
1379 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1384 if data in ("p", "P"):
1388 data = self.stream.char()
1389 if data not in expected:
1395 elif data in ("s", "S"):
1399 data = self.stream.char()
1400 if data not in expected:
1407 # All the characters read before the current 'data' will be
1411 self.stream.unget(data)
1412 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1414 {"data": data}})
1421 data = self.stream.char()
1422 if data in spaceCharacters:
1424 elif data in ("'", '"'):
1425 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1427 self.stream.unget(data)
1429 elif data is EOF:
1430 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1436 self.stream.unget(data)
1441 data = self.stream.char()
1442 if data in spaceCharacters:
1444 elif data == "\"":
1447 elif data == "'":
1450 elif data == ">":
1451 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1456 elif data is EOF:
1457 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1463 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1470 data = self.stream.char()
1471 if data == "\"":
1473 elif data == "\u0000":
1475 "data": "invalid-codepoint"})
1477 elif data == ">":
1478 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1483 elif data is EOF:
1484 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1490 self.currentToken["publicId"] += data
1494 data = self.stream.char()
1495 if data == "'":
1497 elif data == "\u0000":
1499 "data": "invalid-codepoint"})
1501 elif data == ">":
1502 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1507 elif data is EOF:
1508 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1514 self.currentToken["publicId"] += data
1518 data = self.stream.char()
1519 if data in spaceCharacters:
1521 elif data == ">":
1524 elif data == '"':
1525 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1529 elif data == "'":
1530 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1534 elif data is EOF:
1535 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1541 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1548 data = self.stream.char()
1549 if data in spaceCharacters:
1551 elif data == ">":
1554 elif data == '"':
1557 elif data == "'":
1560 elif data == EOF:
1561 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1567 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1574 data = self.stream.char()
1575 if data in spaceCharacters:
1577 elif data in ("'", '"'):
1578 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1580 self.stream.unget(data)
1582 elif data is EOF:
1583 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1589 self.stream.unget(data)
1594 data = self.stream.char()
1595 if data in spaceCharacters:
1597 elif data == "\"":
1600 elif data == "'":
1603 elif data == ">":
1604 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1609 elif data is EOF:
1610 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1616 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1623 data = self.stream.char()
1624 if data == "\"":
1626 elif data == "\u0000":
1628 "data": "invalid-codepoint"})
1630 elif data == ">":
1631 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1636 elif data is EOF:
1637 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1643 self.currentToken["systemId"] += data
1647 data = self.stream.char()
1648 if data == "'":
1650 elif data == "\u0000":
1652 "data": "invalid-codepoint"})
1654 elif data == ">":
1655 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1660 elif data is EOF:
1661 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1667 self.currentToken["systemId"] += data
1671 data = self.stream.char()
1672 if data in spaceCharacters:
1674 elif data == ">":
1677 elif data is EOF:
1678 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1684 self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
1690 data = self.stream.char()
1691 if data == ">":
1694 elif data is EOF:
1696 self.stream.unget(data)
1704 data = []
1706 data.append(self.stream.charsUntil("]"))
1707 data.append(self.stream.charsUntil(">"))
1713 if data[-1][-2:] == "]]":
1714 data[-1] = data[-1][:-2]
1717 data.append(char)
1719 data = "".join(data)
1721 nullCount = data.count("\u0000")
1725 "data": "invalid-codepoint"})
1726 data = data.replace("\u0000", "\uFFFD")
1727 if data:
1729 "data": data})