MCPcopy Index your code
hub / github.com/python/cpython / parse_bogus_comment

Method parse_bogus_comment

Lib/html/parser.py:402–411  ·  view source on GitHub ↗
(self, i, report=1)

Source from the content-addressed store, hash-verified

400 # Internal -- parse bogus comment, return length or -1 if not terminated
401 # see https://html.spec.whatwg.org/multipage/parsing.html#bogus-comment-state
402 def parse_bogus_comment(self, i, report=1):
403 rawdata = self.rawdata
404 assert rawdata[i:i+2] in ('<!', '</'), ('unexpected call to '
405 'parse_bogus_comment()')
406 pos = rawdata.find('>', i+2)
407 if pos == -1:
408 return -1
409 if report:
410 self.handle_comment(rawdata[i+2:pos])
411 return pos + 1
412
413 # Internal -- parse processing instr, return end or -1 if not terminated
414 def parse_pi(self, i):

Callers 2

parse_endtagMethod · 0.95

Calls 2

handle_commentMethod · 0.95
findMethod · 0.45

Tested by

no test coverage detected