]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
remove comments from sed script
authorDavid MacKenzie <djm@djmnet.org>
Wed, 19 Oct 1994 05:41:52 +0000 (05:41 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Wed, 19 Oct 1994 05:41:52 +0000 (05:41 +0000)
bin/ifnames.in
ifnames.in
ifnames.sh

index 895646e54eeda02e2931a5b8ebbabe38cd2640ff..cd95da84423a058a9119005b1686e09235a56aba 100644 (file)
@@ -64,25 +64,25 @@ fi
 
 for arg
 do
+# The first two substitutions remove comments.  Not perfect, but close enough.
+# The second is for comments that end on a later line.  The others do:
+# Enclose identifiers in @ and a space.
+# Handle "#if 0" -- there are no @s to trigger removal.
+# Remove non-identifiers.
+# Remove any spaces at the end.
+# Translate any other spaces to newlines.
 sed -n '
-# Remove comments.  Not perfect, but close enough.
 s%/\*[^/]*\*/%%g
-# Comments that end on a later line.
 s%/\*[^/]*%%g
 /^[    ]*#[    ]*ifn*def[      ][      ]*\([A-Za-z0-9_]*\).*/s//\1/p
 /^[    ]*#[    ]*e*l*if[       ]/{
        s///
        s/@//g
-       # Enclose identifiers in @ and a space.
        s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g
-       # Handle "#if 0" -- there are no @s to trigger removal.
        s/$/@ /
-       # Remove non-identifiers.
        s/@defined //g
        s/[^@]*@\([^ ]* \)[^@]*/\1/g
-       # Remove any spaces at the end.
        s/ *$//
-       # Translate any other spaces to newlines.
        s/ /\
 /g
        p
index 895646e54eeda02e2931a5b8ebbabe38cd2640ff..cd95da84423a058a9119005b1686e09235a56aba 100644 (file)
@@ -64,25 +64,25 @@ fi
 
 for arg
 do
+# The first two substitutions remove comments.  Not perfect, but close enough.
+# The second is for comments that end on a later line.  The others do:
+# Enclose identifiers in @ and a space.
+# Handle "#if 0" -- there are no @s to trigger removal.
+# Remove non-identifiers.
+# Remove any spaces at the end.
+# Translate any other spaces to newlines.
 sed -n '
-# Remove comments.  Not perfect, but close enough.
 s%/\*[^/]*\*/%%g
-# Comments that end on a later line.
 s%/\*[^/]*%%g
 /^[    ]*#[    ]*ifn*def[      ][      ]*\([A-Za-z0-9_]*\).*/s//\1/p
 /^[    ]*#[    ]*e*l*if[       ]/{
        s///
        s/@//g
-       # Enclose identifiers in @ and a space.
        s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g
-       # Handle "#if 0" -- there are no @s to trigger removal.
        s/$/@ /
-       # Remove non-identifiers.
        s/@defined //g
        s/[^@]*@\([^ ]* \)[^@]*/\1/g
-       # Remove any spaces at the end.
        s/ *$//
-       # Translate any other spaces to newlines.
        s/ /\
 /g
        p
index 895646e54eeda02e2931a5b8ebbabe38cd2640ff..cd95da84423a058a9119005b1686e09235a56aba 100644 (file)
@@ -64,25 +64,25 @@ fi
 
 for arg
 do
+# The first two substitutions remove comments.  Not perfect, but close enough.
+# The second is for comments that end on a later line.  The others do:
+# Enclose identifiers in @ and a space.
+# Handle "#if 0" -- there are no @s to trigger removal.
+# Remove non-identifiers.
+# Remove any spaces at the end.
+# Translate any other spaces to newlines.
 sed -n '
-# Remove comments.  Not perfect, but close enough.
 s%/\*[^/]*\*/%%g
-# Comments that end on a later line.
 s%/\*[^/]*%%g
 /^[    ]*#[    ]*ifn*def[      ][      ]*\([A-Za-z0-9_]*\).*/s//\1/p
 /^[    ]*#[    ]*e*l*if[       ]/{
        s///
        s/@//g
-       # Enclose identifiers in @ and a space.
        s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g
-       # Handle "#if 0" -- there are no @s to trigger removal.
        s/$/@ /
-       # Remove non-identifiers.
        s/@defined //g
        s/[^@]*@\([^ ]* \)[^@]*/\1/g
-       # Remove any spaces at the end.
        s/ *$//
-       # Translate any other spaces to newlines.
        s/ /\
 /g
        p