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

Method parse_comment

Lib/_markupbase.py:165–175  ·  view source on GitHub ↗
(self, i, report=1)

Source from the content-addressed store, hash-verified

163
164 # Internal -- parse comment, return length or -1 if not terminated
165 def parse_comment(self, i, report=1):
166 rawdata = self.rawdata
167 if rawdata[i:i+4] != '<!--':
168 raise AssertionError('unexpected call to parse_comment()')
169 match = _commentclose.search(rawdata, i+4)
170 if not match:
171 return -1
172 if report:
173 j = match.start(0)
174 self.handle_comment(rawdata[i+4: j])
175 return match.end(0)
176
177 # Internal -- scan past the internal subset in a <!DOCTYPE declaration,
178 # returning the index just past any whitespace following the trailing ']'.

Callers 2

parse_declarationMethod · 0.95
_parse_doctype_subsetMethod · 0.95

Calls 4

searchMethod · 0.45
startMethod · 0.45
handle_commentMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected