(self, i, report=1)
| 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): |
no test coverage detected