MCPcopy Index your code
hub / github.com/clips/pattern / _scan_name

Method _scan_name

pattern/web/feed/feedparser.py:2025–2040  ·  view source on GitHub ↗
(self, i, declstartpos)

Source from the content-addressed store, hash-verified

2023
2024 _new_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9:]*\s*').match
2025 def _scan_name(self, i, declstartpos):
2026 rawdata = self.rawdata
2027 n = len(rawdata)
2028 if i == n:
2029 return None, -1
2030 m = self._new_declname_match(rawdata, i)
2031 if m:
2032 s = m.group()
2033 name = s.strip()
2034 if (i + len(s)) == n:
2035 return None, -1 # end of buffer
2036 return name.lower(), m.end()
2037 else:
2038 self.handle_data(rawdata)
2039# self.updatepos(declstartpos, i)
2040 return None, -1
2041
2042 def convert_charref(self, name):
2043 return '&#%s;' % name

Callers

nothing calls this directly

Calls 4

handle_dataMethod · 0.95
lenFunction · 0.85
stripMethod · 0.80
groupMethod · 0.45

Tested by

no test coverage detected