diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-09-07 01:17:16 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-09-07 01:17:16 +0000 |
commit | 86038ada178e4cf8f3a541f2720b26761901e769 (patch) | |
tree | 18df56d5a8bc0f1649c6429f0c3d68a3c8c3aef6 /gas/cond.c | |
parent | fca4042a3a74ccc2974d28bbde58e79915799494 (diff) | |
download | gdb-86038ada178e4cf8f3a541f2720b26761901e769.zip gdb-86038ada178e4cf8f3a541f2720b26761901e769.tar.gz gdb-86038ada178e4cf8f3a541f2720b26761901e769.tar.bz2 |
* app.c (do_scrub_chars): In MRI mode, silently end quoted strings
at newline characters. In MRI mode, always keep spaces in the
operands field. In MRI mode, treat a line comment character as a
regular comment character following a space.
* cond.c (ignore_input): Use strncasecmp rather than strncmp when
looking for special pseudo-ops.
* read.c (cons_worker): In MRI mode, the expressions stop at the
first unquoted space.
(equals): Likewise.
Diffstat (limited to 'gas/cond.c')
-rw-r--r-- | gas/cond.c | 50 |
1 files changed, 33 insertions, 17 deletions
@@ -61,19 +61,23 @@ s_ifdef (arg) { as_bad ("invalid identifier for \".ifdef\""); obstack_1grow (&cond_obstack, 0); + ignore_rest_of_line (); } else { - get_symbol_end (); - ++input_line_pointer; + char c; + + c = get_symbol_end (); symbolP = symbol_find (name); + *input_line_pointer = c; initialize_cframe (&cframe); cframe.ignoring = cframe.dead_tree || !((symbolP != 0) ^ arg); - current_cframe = (struct conditional_frame *) obstack_copy (&cond_obstack, &cframe, sizeof (cframe)); + current_cframe = ((struct conditional_frame *) + obstack_copy (&cond_obstack, &cframe, + sizeof (cframe))); + demand_empty_rest_of_line (); } /* if a valid identifyer name */ - - return; } /* s_ifdef() */ void @@ -85,10 +89,19 @@ s_if (arg) int t; SKIP_WHITESPACE (); /* Leading whitespace is part of operand. */ - expression (&operand); - if (operand.X_op != O_constant) - as_bad ("non-constant expression in \".if\" statement"); + if (current_cframe != NULL && current_cframe->ignoring) + { + operand.X_add_number = 0; + while (! is_end_of_line[(unsigned char) *input_line_pointer]) + ++input_line_pointer; + } + else + { + expression (&operand); + if (operand.X_op != O_constant) + as_bad ("non-constant expression in \".if\" statement"); + } switch ((operatorT) arg) { @@ -108,7 +121,8 @@ s_if (arg) cframe.ignoring = cframe.dead_tree || ! t; current_cframe = ((struct conditional_frame *) obstack_copy (&cond_obstack, &cframe, sizeof (cframe))); - return; + + demand_empty_rest_of_line (); } /* s_if() */ /* Get a string for the MRI IFC or IFNC pseudo-ops. */ @@ -268,14 +282,16 @@ ignore_input () } /* We cannot ignore certain pseudo ops. */ - if ((s[0] == 'i' - && (!strncmp (s, "if", 2) - || !strncmp (s, "ifdef", 5) - || !strncmp (s, "ifndef", 6))) - || (s[0] == 'e' - && (!strncmp (s, "else", 4) - || !strncmp (s, "endif", 5) - || !strncmp (s, "endc", 4)))) + if (((s[0] == 'i' + || s[0] == 'I') + && (!strncasecmp (s, "if", 2) + || !strncasecmp (s, "ifdef", 5) + || !strncasecmp (s, "ifndef", 6))) + || ((s[0] == 'e' + || s[0] == 'E') + && (!strncasecmp (s, "else", 4) + || !strncasecmp (s, "endif", 5) + || !strncasecmp (s, "endc", 4)))) return 0; return (current_cframe != NULL) && (current_cframe->ignoring); |