Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else").
(self, directive)
| 749 | return -1 |
| 750 | |
| 751 | def ResetSection(self, directive): |
| 752 | """Reset section checking for preprocessor directive. |
| 753 | |
| 754 | Args: |
| 755 | directive: preprocessor directive (e.g. "if", "else"). |
| 756 | """ |
| 757 | # The name of the current section. |
| 758 | self._section = self._INITIAL_SECTION |
| 759 | # The path of last found header. |
| 760 | self._last_header = '' |
| 761 | |
| 762 | # Update list of includes. Note that we never pop from the |
| 763 | # include list. |
| 764 | if directive in ('if', 'ifdef', 'ifndef'): |
| 765 | self.include_list.append([]) |
| 766 | elif directive in ('else', 'elif'): |
| 767 | self.include_list[-1] = [] |
| 768 | |
| 769 | def SetLastHeader(self, header_path): |
| 770 | self._last_header = header_path |
no test coverage detected