In perl.git, the branch khw/ebcdic has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/6218d62a73513b0886675460c65ba0bbd32ca021?hp=6d4b52d1cc9836f1929b2e0f4a55df9cb914351c>

- Log -----------------------------------------------------------------
commit 6218d62a73513b0886675460c65ba0bbd32ca021
Author: Karl Williamson <[email protected]>
Date:   Wed Feb 27 16:13:24 2013 -0700

    makedepend.SH: Split very long preprocessor lines
    
    This avoids preprocessor limitations

M       makedepend.SH

commit cd92ae5e63b2460c36f920cc4248e40147a20033
Author: Karl Williamson <[email protected]>
Date:   Wed Feb 27 15:51:28 2013 -0700

    makedepend.SH: White-space only
    
    Align continuation backslashes

M       makedepend.SH

commit d2283987025677e86ac6e65b5a45e4d84d1525b5
Author: Karl Williamson <[email protected]>
Date:   Wed Feb 27 14:39:28 2013 -0700

    makedepend.SH: Remove some unnecessary white space
    
    Multi-line preprocessor directives are now joined into single lines.
    This can create lines too long for the preprocessor to handle.  This
    commit removes blanks adjoining comments that get deleted.  Also, the
    join is forced to be a single white space.  This makes things somewhat
    less likely to exceed the limit.
    
    This commit also fixes several [] which were meant to each match a tab
    or a blank, but editors converted the tabs to blanks

M       makedepend.SH

commit 054e96452d650b4dae27eee8f410a919caf10e49
Author: Karl Williamson <[email protected]>
Date:   Wed Feb 27 14:30:51 2013 -0700

    makedepend.SH: Retain '/**/' comments
    
    These comments may actually be necessary.

M       makedepend.SH

commit 37f6fd29ef7f90cf9c1461eee42685fd15c80a91
Merge: 3f4ba4b 6d4b52d
Author: Karl Williamson <[email protected]>
Date:   Wed Feb 27 11:44:00 2013 -0700

    Merge branch 'khw/ebcdic' of ssh://perl5.git.perl.org/perl into ebcdic

commit 3f4ba4b4a7bdeb2e6aaad5f331164866fa3bc851
Author: Karl Williamson <[email protected]>
Date:   Wed Feb 27 08:38:19 2013 -0700

    handy.h: Remove extraneous parens

M       handy.h
-----------------------------------------------------------------------

Summary of changes:
 handy.h       |    2 +-
 makedepend.SH |   54 ++++++++++++++++++++++++++++++++----------------------
 2 files changed, 33 insertions(+), 23 deletions(-)

diff --git a/handy.h b/handy.h
index 8ca7bd4..2777f23 100644
--- a/handy.h
+++ b/handy.h
@@ -897,7 +897,7 @@ EXTCONST U32 PL_charclass[];
 #   define isUPPER_A(c)  _generic_isCC_A(c, _CC_UPPER)
 #   define isWORDCHAR_A(c) _generic_isCC_A(c, _CC_WORDCHAR)
 #   define isXDIGIT_A(c)  _generic_isCC(c, _CC_XDIGIT)
-#   define isIDFIRST_A(c) _generic_isCC_A(c, ( _CC_IDFIRST))
+#   define isIDFIRST_A(c) _generic_isCC_A(c, _CC_IDFIRST)
 
     /* Either participates in a fold with a character above 255, or is a
      * multi-char fold */
diff --git a/makedepend.SH b/makedepend.SH
index f709575..3f0ef94 100755
--- a/makedepend.SH
+++ b/makedepend.SH
@@ -141,29 +141,39 @@ for file in `$cat .clist`; do
     #          && defined(BAR) /* comment */ \
     #          && defined(BAZ) /* comment */ \
     #               etc.
-    # This code processes these latter situations first; it assumes there is
-    # at most one straightforward comment per continued preprocessor line.  (It
-    # would be easier to handle more general cases if sed had a non-greedy '*'
-    # quantifier; but typically preprocessor directive lines are rather
-    # simple.)  The continuation line is joined, and the process repeated on
+    # Also, in lines like
+    #      #defined FOO(a,b)    a/**/b
+    # the comment may be important and so needs to be retained.
+    # This code processes the single-line comments first; it assumes there is
+    # at most one straightforward comment per continued preprocessor line, 
replacing
+    # each non-empty comment (and its surrounding white space) by a single
+    # space.  (sed only has a greedy '*' quantifier, so this doesn't work right
+    # if there are multiple comments per line; unlikely in a preprocessor
+    # statement.) Any continuation line is joined, and the process repeated on
     # the enlarged line as long as there are continuations.  At the end, if
-    # there are any comments remaining, they should be like the first 
situation,
-    # and can just be deleted.  (Subsequent lines of the comment are irrelevant
-    # and get dropped.)
-    ( $echo "#line 2 \"$file\""; \
-      $sed -n <$file \
-       -e "/^${filebase}_init(/q" \
-        -e ': testcontinuation'       \
-       -e '/^[  ]*#/s|/\*.*\*/||'    \
-        -e '/\\$/{'                   \
-            -e 'N'                    \
-            -e 'b testcontinuation'   \
-        -e '}'                        \
-        -e 's/\\\n/ /g'               \
-       -e '/^#line/d' \
-       -e '/^[  ]*#/{' \
-       -e 's|/\*.*$||' \
-       -e p \
+    # there are any comments remaining, they are either completely empty or are
+    # like the first situation.  The latter are just deleted by first deleting
+    # to the end of line (including preceding white space) things that start
+    # with '/*' and the next char isn't a '*'; then things that start with
+    # '/**', but the next char isn't a '/'.  (Subsequent lines of the comment
+    # are irrelevant and get dropped.)  At the end, we unjoin very long lines
+    # to avoid preprocessor limitations
+    ( $echo "#line 2 \"$file\"";                               \
+      $sed -n <$file                                           \
+       -e "/^${filebase}_init(/q"                             \
+        -e ': testcontinuation'                                \
+       -e '/^[         ]*#/s|[         ]*/\*..*\*/[    ]*| |' \
+        -e '/\\$/{'                                            \
+            -e 'N'                                             \
+            -e 'b testcontinuation'                            \
+        -e '}'                                                 \
+       -e 's/[         ]*\\\n[         ]*/ /g'                \
+       -e '/^#line/d'                                         \
+       -e '/^[         ]*#/{'                                 \
+           -e 's|[     ]*/\*[^*].*$||'                        \
+           -e 's|[     ]*/\*\*[^/].*$||'                      \
+            -e 's/.\{1000\}/&\\\n/g'                           \
+           -e p                                               \
        -e '}' ) >UU/$file.c
 
     # We're not sure why this was there; the #endif is extraneous on modern 
z/OS

--
Perl5 Master Repository

Reply via email to