gas: parsing source lines containing macro args
Andrew Haley
aph@pasanda.cygnus.co.uk
Tue Nov 9 09:18:00 GMT 1999
> Date: 8 Nov 1999 12:06:37 -0500
> From: Ian Lance Taylor <ian@zembu.com>
>
> I think your patch is OK, provided the current testsuite passes. But
> I think your comment should be changed to indicate that we don't
> actually have enough information to make the right choice, and that we
> are making the choice which is more likely to be correct.
Checked in like this.
Andrew.
1999-11-08 Andrew Haley <aph@cygnus.com>
* app.c (do_scrub_chars): When in State 10, treat backslash
characters in the same way as as symbol characters.
Index: app.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/app.c,v
retrieving revision 1.3
diff -p -r1.3 app.c
*** app.c 1999/07/11 20:19:53 1.3
--- app.c 1999/11/09 17:14:20
*************** do_scrub_chars (get, tostart, tolen)
*** 1227,1232 ****
--- 1227,1249 ----
}
else if (state == 10)
{
+ if (ch == '\\')
+ {
+ /* Special handling for backslash: a backslash may
+ be the beginning of a formal parameter (of a
+ macro) following another symbol character, with
+ whitespace in between. If that is the case, we
+ output a space before the parameter. Strictly
+ speaking, correct handling depends upon what the
+ macro parameter expands into; if the parameter
+ expands into something which does not start with
+ an operand character, then we don't want to keep
+ the space. We don't have enough information to
+ make the right choice, so here we are making the
+ choice which is more likely to be correct. */
+ PUT (' ');
+ }
+
state = 3;
}
PUT (ch);
More information about the Binutils
mailing list