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

Method parse_marked_section

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

Source from the content-addressed store, hash-verified

139 # Internal -- parse a marked section
140 # Override this to handle MS-word extension syntax <![if word]>content<![endif]>
141 def parse_marked_section(self, i, report=1):
142 rawdata= self.rawdata
143 assert rawdata[i:i+3] == '<![', "unexpected call to parse_marked_section()"
144 sectName, j = self._scan_name( i+3, i )
145 if j < 0:
146 return j
147 if sectName in {"temp", "cdata", "ignore", "include", "rcdata"}:
148 # look for standard ]]> ending
149 match= _markedsectionclose.search(rawdata, i+3)
150 elif sectName in {"if", "else", "endif"}:
151 # look for MS Office ]> ending
152 match= _msmarkedsectionclose.search(rawdata, i+3)
153 else:
154 raise AssertionError(
155 'unknown status keyword %r in marked section' % rawdata[i+3:j]
156 )
157 if not match:
158 return -1
159 if report:
160 j = match.start(0)
161 self.unknown_decl(rawdata[i+3: j])
162 return match.end(0)
163
164 # Internal -- parse comment, return length or -1 if not terminated
165 def parse_comment(self, i, report=1):

Callers 1

parse_declarationMethod · 0.95

Calls 5

_scan_nameMethod · 0.95
unknown_declMethod · 0.95
searchMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected