3.6 while-if-while bug

This commit is contained in:
rocky
2018-02-26 01:27:00 -05:00
parent d09e820d89
commit 195075ac01
3 changed files with 11 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,9 @@
# From 3.6 _markupbase.py
# Bug was parsing the inner while
def _parse_doctype_subset(c, j, rawdata, n):
while n:
if c:
j += 1
while j < n and rawdata[j]:
j += 1
return -1

View File

@@ -30,6 +30,8 @@ class Python36Parser(Python35Parser):
for_block ::= l_stmts_opt come_from_loops JUMP_BACK
come_from_loops ::= COME_FROM_LOOP*
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt
JUMP_BACK COME_FROM POP_BLOCK COME_FROM_LOOP
# This might be valid in < 3.6
and ::= expr jmp_false expr