s_elseif (arg)
int arg;
{
- expressionS operand;
- int t;
-
if (current_cframe == NULL)
{
as_bad (_("\".elseif\" without matching \".if\" - ignored"));
as_where (¤t_cframe->else_file_line.file,
¤t_cframe->else_file_line.line);
- if (!current_cframe->dead_tree)
- {
- current_cframe->dead_tree = !current_cframe->ignoring;
- current_cframe->ignoring = !current_cframe->ignoring;
- if (LISTING_SKIP_COND ())
- {
- if (! current_cframe->ignoring)
- listing_list (1);
- else
- listing_list (2);
- }
- } /* if not a dead tree */
- } /* if error else do it */
+ current_cframe->dead_tree |= !current_cframe->ignoring;
+ current_cframe->ignoring = current_cframe->dead_tree;
+ }
if (current_cframe == NULL || current_cframe->ignoring)
{
while (! is_end_of_line[(unsigned char) *input_line_pointer])
++input_line_pointer;
- return;
+
+ if (current_cframe == NULL)
+ return;
}
+ else
+ {
+ expressionS operand;
+ int t;
- /* Leading whitespace is part of operand. */
- SKIP_WHITESPACE ();
+ /* Leading whitespace is part of operand. */
+ SKIP_WHITESPACE ();
- expression (&operand);
- if (operand.X_op != O_constant)
- as_bad (_("non-constant expression in \".elseif\" statement"));
+ expression (&operand);
+ if (operand.X_op != O_constant)
+ as_bad (_("non-constant expression in \".elseif\" statement"));
- switch ((operatorT) arg)
- {
- case O_eq: t = operand.X_add_number == 0; break;
- case O_ne: t = operand.X_add_number != 0; break;
- case O_lt: t = operand.X_add_number < 0; break;
- case O_le: t = operand.X_add_number <= 0; break;
- case O_ge: t = operand.X_add_number >= 0; break;
- case O_gt: t = operand.X_add_number > 0; break;
- default:
- abort ();
- return;
- }
+ switch ((operatorT) arg)
+ {
+ case O_eq: t = operand.X_add_number == 0; break;
+ case O_ne: t = operand.X_add_number != 0; break;
+ case O_lt: t = operand.X_add_number < 0; break;
+ case O_le: t = operand.X_add_number <= 0; break;
+ case O_ge: t = operand.X_add_number >= 0; break;
+ case O_gt: t = operand.X_add_number > 0; break;
+ default:
+ abort ();
+ return;
+ }
- current_cframe->ignoring = current_cframe->dead_tree || ! t;
+ current_cframe->ignoring = current_cframe->dead_tree || ! t;
+ }
if (LISTING_SKIP_COND ()
- && current_cframe->ignoring
&& (current_cframe->previous_cframe == NULL
|| ! current_cframe->previous_cframe->ignoring))
- listing_list (2);
+ {
+ if (! current_cframe->ignoring)
+ listing_list (1);
+ else
+ listing_list (2);
+ }
demand_empty_rest_of_line ();
}
if (current_cframe == NULL)
{
as_bad (_(".else without matching .if - ignored"));
-
}
else if (current_cframe->else_seen)
{
as_where (¤t_cframe->else_file_line.file,
¤t_cframe->else_file_line.line);
- if (!current_cframe->dead_tree)
+ current_cframe->ignoring =
+ current_cframe->dead_tree | !current_cframe->ignoring;
+
+ if (LISTING_SKIP_COND ()
+ && (current_cframe->previous_cframe == NULL
+ || ! current_cframe->previous_cframe->ignoring))
{
- current_cframe->ignoring = !current_cframe->ignoring;
- if (LISTING_SKIP_COND ())
- {
- if (! current_cframe->ignoring)
- listing_list (1);
- else
- listing_list (2);
- }
- } /* if not a dead tree */
+ if (! current_cframe->ignoring)
+ listing_list (1);
+ else
+ listing_list (2);
+ }
current_cframe->else_seen = 1;
- } /* if error else do it */
+ }
if (flag_mri)
{
/* listing.c - mainting assembly listings
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
show_listing--;
break;
case EDICT_NOLIST_NEXT:
+ if (show_listing == 0)
+ list_line--;
break;
case EDICT_EJECT:
break;
p = buffer_line (list->file, buffer, width);
}
- if (list->edict == EDICT_LIST)
+ if (list->edict == EDICT_LIST
+ || (list->edict == EDICT_NOLIST_NEXT && show_listing == 0))
{
/* Enable listing for the single line that caused the enable. */
list_line++;
}
}
- if (list->edict == EDICT_NOLIST_NEXT)
+ if (list->edict == EDICT_NOLIST_NEXT && show_listing == 1)
--show_listing;
list = list->next;