@@ -100,6 +100,14 @@ def lexer(self, line):
100
100
else :
101
101
self .__excludeblock = False
102
102
return False , True
103
+ # handle #ifnotdef directives (is the same as: #ifdef X #else)
104
+ elif line [:9 ] == self .escapeChar + 'ifdefnot' :
105
+ if len (line .split ()) != 2 :
106
+ self .exit_error (self .escapeChar + 'ifdefnot' )
107
+ else :
108
+ self .__ifblocks .append (not (self .search_defines (line .split ()[1 ])))
109
+ self .__ifconditions .append (line .split ()[1 ])
110
+ return False , True
103
111
# handle #ifdef directives
104
112
elif line [:6 ] == self .escapeChar + 'ifdef' :
105
113
if len (line .split ()) != 2 :
@@ -114,7 +122,7 @@ def lexer(self, line):
114
122
if len (line .split ()) != 2 :
115
123
self .exit_error (self .escapeChar + 'elseif' )
116
124
else :
117
- self .__ifblocks [- 1 ]= not (self .search_defines (self .__ifconditions [- 1 ]))
125
+ self .__ifblocks [- 1 ]= not (self .__ifblocks [ - 1 ]) #self. search_defines(self.__ifconditions[-1]))
118
126
self .__ifblocks .append (self .search_defines (line .split ()[1 ]))
119
127
self .__ifconditions .append (line .split ()[1 ])
120
128
return False , True
@@ -123,7 +131,7 @@ def lexer(self, line):
123
131
if len (line .split ()) != 1 :
124
132
self .exit_error (self .escapeChar + 'else' )
125
133
else :
126
- self .__ifblocks [- 1 ]= not (self .search_defines (self .__ifconditions [- 1 ]))
134
+ self .__ifblocks [- 1 ]= not (self .__ifblocks [ - 1 ]) #self. search_defines(self.__ifconditions[-1]))
127
135
return False , True
128
136
# handle #endif..
129
137
# handle #endifall directives
0 commit comments