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

Method _scan_name

Lib/_markupbase.py:376–392  ·  view source on GitHub ↗
(self, i, declstartpos)

Source from the content-addressed store, hash-verified

374 # Internal -- scan a name token and the new position and the token, or
375 # return -1 if we've reached the end of the buffer.
376 def _scan_name(self, i, declstartpos):
377 rawdata = self.rawdata
378 n = len(rawdata)
379 if i == n:
380 return None, -1
381 m = _declname_match(rawdata, i)
382 if m:
383 s = m.group()
384 name = s.strip()
385 if (i + len(s)) == n:
386 return None, -1 # end of buffer
387 return name.lower(), m.end()
388 else:
389 self.updatepos(declstartpos, i)
390 raise AssertionError(
391 "expected name token at %r" % rawdata[declstartpos:declstartpos+20]
392 )
393
394 # To be overridden -- handlers for unknown objects
395 def unknown_decl(self, data):

Callers 7

parse_declarationMethod · 0.95
parse_marked_sectionMethod · 0.95
_parse_doctype_subsetMethod · 0.95
_parse_doctype_entityMethod · 0.95

Calls 5

updateposMethod · 0.95
groupMethod · 0.45
stripMethod · 0.45
lowerMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected