Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else").
(self, directive)
| 1126 | return -1 |
| 1127 | |
| 1128 | def ResetSection(self, directive): |
| 1129 | """Reset section checking for preprocessor directive. |
| 1130 | |
| 1131 | Args: |
| 1132 | directive: preprocessor directive (e.g. "if", "else"). |
| 1133 | """ |
| 1134 | # The name of the current section. |
| 1135 | self._section = self._INITIAL_SECTION |
| 1136 | # The path of last found header. |
| 1137 | self._last_header = '' |
| 1138 | |
| 1139 | # Update list of includes. Note that we never pop from the |
| 1140 | # include list. |
| 1141 | if directive in ('if', 'ifdef', 'ifndef'): |
| 1142 | self.include_list.append([]) |
| 1143 | elif directive in ('else', 'elif'): |
| 1144 | self.include_list[-1] = [] |
| 1145 | |
| 1146 | def SetLastHeader(self, header_path): |
| 1147 | self._last_header = header_path |
no test coverage detected