diff options
author | Bruce Korb <ddsinc09@ix.netcom.com> | 1999-06-22 09:39:06 +0000 |
---|---|---|
committer | Bruce Korb <korbb@gcc.gnu.org> | 1999-06-22 09:39:06 +0000 |
commit | 15b183364a1ddb7deffc6e96abbd7104898e2a33 (patch) | |
tree | c92403fc780143de7c2cbcb910ae9517021ea6d0 /gcc/fixinc/inclhack.def | |
parent | 69f00f0151543845d1ac41ecf8cf3609691890c1 (diff) | |
download | gcc-15b183364a1ddb7deffc6e96abbd7104898e2a33.tar.gz |
inclhack.def (end_else_label): combined else_label and endif_label and fixed the sed expression.
*fixinc/inclhack.def(end_else_label): combined else_label
and endif_label and fixed the sed expression.
*fixinc/{fixincl.x|inclhack.sh}: regen
From-SVN: r27703
Diffstat (limited to 'gcc/fixinc/inclhack.def')
-rw-r--r-- | gcc/fixinc/inclhack.def | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index 5f852236062..94aeb88784c 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -416,31 +416,13 @@ fix = { /* - * Fix else directives that contain non-commentary text - * - * The fixinc_eol stuff is to work around a bug in the sed + * Fix else and endif directives that contain non-commentary text */ fix = { - hackname = else_label; - select = "^[ \t]*#[ \t]*else[ \t]+[!-.0-~]"; - sed = ":loop\n" - '/\\\\$/' "N\n" - 's/\\\\$/\\\\+++fixinc_eol+++/' "\n" - '/\\\\$/' "b loop\n" - 's/\\\\+++fixinc_eol+++/\\\\/g' "\n" + hackname = end_else_label; - "s%^\\([ \t]*#[ \t]*else\\)[ \t]*/[^*].*%\\1%\n" - "s%^\\([ \t]*#[ \t]*else\\)[ \t]*[^/ \t].*%\\1%"; -}; - - -/* - * Fix endif directives that contain non-commentary text - */ -fix = { - hackname = endif_label; /* - * Select files that contain '#endif' directives with + * Select files that contain '#endif' or '#else' directives with * some sort of following junk. (Between the ascii '.' * and '0' lies the character '/'. This will *NOT* * match '#endif / * foo * /', but it also wont match @@ -452,13 +434,14 @@ fix = { * "#endif /% blah %/ which appear on OSF4.0A and AIX4.2 * repsectively. * - * We use the pattern [!-.0-z{|}~] instead of [^/ \t] to match a noncomment - * following #else or #endif because some buggy egreps think [^/] matches - * newline, and they thus think `#else ' matches + * We use the pattern [!-.0-z{|}~] instead of [^/ \t] to match a + * noncomment following #else or #endif because some buggy egreps + * think [^/] matches newline, and they thus think `#else ' matches * `#e[ndiflse]*[ \t]+[^/ \t]'. * [!-.0-~] does not work properly on AIX 4.1. */ - select = "^[ \t]*#[ \t]*endif[ \t]+[!-.0-z\{\|\}\~]|^[ \t]*#[ \t]*endif[ \t]+/[^\*]"; + select = "^[ \t]*#[ \t]*(else|endif)[ \t]+" + "(" '[!-.0-z\{\|\}\~]' "|" '/[^\*]' ")"; /* * First, join the continued input lines. @@ -476,9 +459,11 @@ fix = { '/\\\\$/' "b loop\n" 's/\\\\+++fixinc_eol+++/\\\\/g' "\n" - "s%^\\([ \t]*#[ \t]*endif\\)[ \t]*/[^*].*%\\1%\n" - "s%^\\([ \t]*#[ \t]*endif\\)[ \t]*\\*[^/].*%\\1%\n" - "s%^\\([ \t]*#[ \t]*endif\\)[ \t]*[^/* \t].*%\\1%"; + "s%^\\([ \t]*#[ \t]*else\\)[ \t][ \t]*/[^*].*%\\1%\n" + "s%^\\([ \t]*#[ \t]*else\\)[ \t][ \t]*[^/ \t].*%\\1%\n" + "s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*/[^*].*%\\1%\n" + "s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*\*[^/].*%\\1%\n" + "s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*[^/* \t].*%\\1%"; }; |