}
PRIVATE
-skip_block()
+skip_block(to_endif)
{
/* skip_block() skips the input from
1) a false #if, #ifdef, #ifndef or #elif until the
push_if();
continue;
case K_ELIF:
- if (nestlevel == skiplevel) {
+ if (! to_endif && nestlevel == skiplevel) {
nestlevel--;
push_if();
if (ifexpr()) {
}
break;
case K_ELSE:
- ++(ifstack[nestlevel]);
- if (nestlevel == skiplevel) {
- PushBack();
- skipline();
- NoUnstack--;
- return;
+ if (! to_endif) {
+ ++(ifstack[nestlevel]);
+ if (nestlevel == skiplevel) {
+ PushBack();
+ skipline();
+ NoUnstack--;
+ return;
+ }
}
break;
case K_ENDIF:
else { /* restart at this level as if a #if is detected. */
nestlevel--;
push_if();
- skip_block();
+ skip_block(1);
}
}
error("#else without corresponding #if");
else { /* mark this level as else-d */
++(ifstack[nestlevel]);
- skip_block();
+ skip_block(1);
}
}
{
push_if();
if (!ifexpr()) /* a false #if/#elif expression */
- skip_block();
+ skip_block(0);
}
PRIVATE
(how && !id->id_macro) || (!how && id->id_macro)
*/
if (how ^ (id && id->id_macro != 0))
- skip_block();
+ skip_block(0);
else {
PushBack();
skipline();