Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else").
(self, directive)
| 1310 | return -1 |
| 1311 | |
| 1312 | def ResetSection(self, directive): |
| 1313 | """Reset section checking for preprocessor directive. |
| 1314 | |
| 1315 | Args: |
| 1316 | directive: preprocessor directive (e.g. "if", "else"). |
| 1317 | """ |
| 1318 | # The name of the current section. |
| 1319 | self._section = self._INITIAL_SECTION |
| 1320 | # The path of last found header. |
| 1321 | self._last_header = "" |
| 1322 | |
| 1323 | # Update list of includes. Note that we never pop from the |
| 1324 | # include list. |
| 1325 | if directive in ("if", "ifdef", "ifndef"): |
| 1326 | self.include_list.append([]) |
| 1327 | elif directive in ("else", "elif"): |
| 1328 | self.include_list[-1] = [] |
| 1329 | |
| 1330 | def SetLastHeader(self, header_path): |
| 1331 | self._last_header = header_path |
no test coverage detected