Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else").
(self, directive)
| 1141 | return -1 |
| 1142 | |
| 1143 | def ResetSection(self, directive): |
| 1144 | """Reset section checking for preprocessor directive. |
| 1145 | |
| 1146 | Args: |
| 1147 | directive: preprocessor directive (e.g. "if", "else"). |
| 1148 | """ |
| 1149 | # The name of the current section. |
| 1150 | self._section = self._INITIAL_SECTION |
| 1151 | # The path of last found header. |
| 1152 | self._last_header = '' |
| 1153 | |
| 1154 | # Update list of includes. Note that we never pop from the |
| 1155 | # include list. |
| 1156 | if directive in ('if', 'ifdef', 'ifndef'): |
| 1157 | self.include_list.append([]) |
| 1158 | elif directive in ('else', 'elif'): |
| 1159 | self.include_list[-1] = [] |
| 1160 | |
| 1161 | def SetLastHeader(self, header_path): |
| 1162 | self._last_header = header_path |
no test coverage detected