gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, feature/fix-comments, updated. gawk-4.1.


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, feature/fix-comments, updated. gawk-4.1.0-1707-gdd0cfe0
Date: Sat, 19 Mar 2016 20:06:39 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, feature/fix-comments has been updated
       via  dd0cfe0cb3138755733c6578366cebc239e7017d (commit)
       via  2fcbc7891d4440a30ff000ee39b0662f155a64ab (commit)
      from  b040b8f577a203efbd39be90d1554267c5bf15ba (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=dd0cfe0cb3138755733c6578366cebc239e7017d

commit dd0cfe0cb3138755733c6578366cebc239e7017d
Author: Arnold D. Robbins <address@hidden>
Date:   Sat Mar 19 22:06:24 2016 +0200

    New profile test.

diff --git a/test/ChangeLog b/test/ChangeLog
index 7146dbb..edacd49 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,6 +1,8 @@
 2016-03-19         Arnold D. Robbins     <address@hidden>
 
        * profile5.ok: Adjust after code changes.
+       * Makefile.am (profile10): New test.
+       * profile10.awk, profile10.ok: New files.
 
 2016-02-18         Arnold D. Robbins     <address@hidden>
 
diff --git a/test/Makefile.am b/test/Makefile.am
index 2147d34..776dfbd 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -778,6 +778,8 @@ EXTRA_DIST = \
        profile8.ok \
        profile9.awk \
        profile9.ok \
+       profile10.awk \
+       profile10.ok \
        prt1eval.awk \
        prt1eval.ok \
        prtoeval.awk \
@@ -1134,7 +1136,7 @@ GAWK_EXT_TESTS = \
        nonfatal1 nonfatal2 nonfatal3 \
        patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge 
procinfs \
        profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 
\
-       profile8 profile9 pty1 \
+       profile8 profile9 profile10 pty1 \
        rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline 
rsglstdin rsstart1 \
        rsstart2 rsstart3 rstest6 shadow shadowbuiltin \
        sortfor sortu split_after_fpat \
@@ -1869,6 +1871,11 @@ profile9:
        @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/address@hidden > /dev/null
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+profile10:
+       @echo $@
+       @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/address@hidden > /dev/null
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 posix2008sub:
        @echo $@
        @$(AWK) --posix -f "$(srcdir)"/address@hidden > _$@ 2>&1
diff --git a/test/Makefile.in b/test/Makefile.in
index 927be04..7c3a5a0 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1035,6 +1035,8 @@ EXTRA_DIST = \
        profile8.ok \
        profile9.awk \
        profile9.ok \
+       profile10.awk \
+       profile10.ok \
        prt1eval.awk \
        prt1eval.ok \
        prtoeval.awk \
@@ -1390,7 +1392,7 @@ GAWK_EXT_TESTS = \
        nonfatal1 nonfatal2 nonfatal3 \
        patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge 
procinfs \
        profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 
\
-       profile8 profile9 pty1 \
+       profile8 profile9 profile10 pty1 \
        rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline 
rsglstdin rsstart1 \
        rsstart2 rsstart3 rstest6 shadow shadowbuiltin \
        sortfor sortu split_after_fpat \
@@ -2308,6 +2310,11 @@ profile9:
        @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/address@hidden > /dev/null
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+profile10:
+       @echo $@
+       @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/address@hidden > /dev/null
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 posix2008sub:
        @echo $@
        @$(AWK) --posix -f "$(srcdir)"/address@hidden > _$@ 2>&1
diff --git a/test/profile10.awk b/test/profile10.awk
new file mode 100644
index 0000000..3bb2947
--- /dev/null
+++ b/test/profile10.awk
@@ -0,0 +1,39 @@
+BEGIN {                        # Comment 0
+       if (1) {        # Comment 1
+               print "ABC"     # Comment2
+       } else {        # Comment 3
+               print "XYZ"     # Comment 4
+       }                       # Comment 5
+
+       while (c == d) {        # Comment 6
+               print "DEF"     # Comment 7
+       }                       # Comment 8
+
+       do {                    # Comment 9
+               print "GHI"     # Comment 10
+       } while (e == f)        # Comment 11
+
+       for (i in data) {       # Comment 12
+               print "JKL"     # Comment 13
+       }                       # Comment 14
+
+       for (z = 1; z <= 10; z++) {     # Comment 15
+               print "MNO"             # Comment 16
+       }                               # Comment 17
+
+       switch (q) {    # Comment 18
+       case "a":       # Comment 19
+       case "b":
+               # Comment 20
+               break   # Comment 21
+       default:        # Comment 22
+               break   # Comment 23
+       }               # Comment 24
+
+       if (1) {
+               print "foo"
+       }               # Comment 25
+
+       # Comment 26
+}
+# Comment 27
diff --git a/test/profile10.ok b/test/profile10.ok
new file mode 100644
index 0000000..9d4840c
--- /dev/null
+++ b/test/profile10.ok
@@ -0,0 +1,37 @@
+BEGIN {        # Comment 0
+       if (1) {        # Comment 1
+               print "ABC"     # Comment2
+       } else {        # Comment 3
+               print "XYZ"     # Comment 4
+       }       # Comment 5
+       while (c == d) {        # Comment 6
+               print "DEF"     # Comment 7
+       }       # Comment 8
+       do {    # Comment 9
+               print "GHI"     # Comment 10
+       } while (e == f)        # Comment 11
+       for (i in data) {       # Comment 12
+               print "JKL"     # Comment 13
+       }       # Comment 14
+       for (z = 1; z <= 10; z++) {     # Comment 15
+               print "MNO"     # Comment 16
+       }       # Comment 17
+       switch (q) {
+       case "a":
+               # Comment 18
+       case "b":
+               # Comment 19
+               break   # Comment 20
+               # Comment 21
+       default:
+               # Comment 22
+               break   # Comment 23
+       }
+       # Comment 24
+       if (1) {
+               print "foo"
+       }       # Comment 25
+       # Comment 26
+}
+
+# Comment 27

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=2fcbc7891d4440a30ff000ee39b0662f155a64ab

commit 2fcbc7891d4440a30ff000ee39b0662f155a64ab
Author: Arnold D. Robbins <address@hidden>
Date:   Sat Mar 19 22:01:49 2016 +0200

    More code improvements. Add ChangeLog. Update test.

diff --git a/ChangeLog b/ChangeLog
index 52965d5..fcb9a2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2016-03-19         Arnold D. Robbins     <address@hidden>
+
+       Considerable improvements to handling of comments when pretty
+       printing, particularly for end-of-line comments.
+
+       * awkgram.y (prior_comment, comment_to_save): New variables.
+       (add_pending_comment): New function.
+       (grammar): Jump through lots more hoops to capture comments.
+       Due to shift-reduce parsing, there can be up to two comments
+       captured and waiting to be saved; be sure to get them both and
+       at the right times.  This is difficult since comments have no
+       real syntactic exisitence. Call add_pending_comment on most of
+       the simple statements.
+       (get_comment): Save a pre-existing comment in prior_comment.
+       (split_comment): Use comment_to_save instead of `comment'.
+       * profile.c (end_line): Change to return the instruction after
+       the comment that gets printed; adjust return type.
+       (pprint): Add skip_comment static variable. Adjust logic for
+       skipping an end-of-line comment; only do it if skip_comment is
+       true. This is set to true in places where we can't use the
+       return value from end_line().  Call end_line() in many more places.
+       (pp_func): Handle end-of-line comments after a function header.
+
 2016-03-17         Arnold D. Robbins     <address@hidden>
 
        * debug.c (print_instruction): For Op_comment, improve notation as
diff --git a/profile.c b/profile.c
index 531c6e4..b679719 100644
--- a/profile.c
+++ b/profile.c
@@ -932,9 +932,10 @@ cleanup:
                        if (pc->nexti->opcode == Op_no_op) {    /* no following 
else */
                                indent(SPACEOVER);
                                fprintf(prof_fp, "}");
-//                             pc = end_line(pc->nexti);
-                               end_line(pc->nexti);
-                               skip_comment = true;
+                               if (pc->nexti->nexti->opcode != Op_comment)
+                                       fprintf(prof_fp, "\n");
+                               /* else
+                                       It will be printed at the top. */
                        }
                        /*
                         * See next case; turn off the flag so that the
diff --git a/test/ChangeLog b/test/ChangeLog
index 66bed64..7146dbb 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2016-03-19         Arnold D. Robbins     <address@hidden>
+
+       * profile5.ok: Adjust after code changes.
+
 2016-02-18         Arnold D. Robbins     <address@hidden>
 
        * profile2.ok, profile5.ok: Adjust after code changes.
diff --git a/test/profile5.ok b/test/profile5.ok
index 272336b..602702c 100644
--- a/test/profile5.ok
+++ b/test/profile5.ok
@@ -999,12 +999,12 @@ function _FILEIO(c, t, P, A)
 ############################################################
 function _FILEVER(c, t, P, a, A)
 {
-       #################################################
+       
#_____________________________________________________________________________
        switch (c) {
        case "_lib_CMDLN":
-               #___________________________________________________________
+               #################################################
                return t
-               
#_____________________________________________________________________________
+               #___________________________________________________________
                #_____________________________________________________
        case "_lib_APPLY":
                return 
@@ -1591,10 +1591,9 @@ function _addlist(A, v)
 ############################################
 function _bearray(A)
 {
-       ####################################################
+       #_______________________________________________________________________
        if (isarray(A) || A == 0 && A == "") {
-               return 1
-               
#_______________________________________________________________________
+               return 1        
####################################################
        }
 }
 
@@ -2185,8 +2184,7 @@ function _dll_check_i0(p, R, pp, p2, i, i2, r, f, v, rs, 
d, tv, tf)
                                        }
                                }
                        }
-               }
-               #{ rs=_missfl=1; _[p]["." 
gensub(/^([^\\]+\\)+(.*)\..../,"\\2","G",i)]=R[i] } }
+               }       #{ rs=_missfl=1; _[p]["." 
gensub(/^([^\\]+\\)+(.*)\..../,"\\2","G",i)]=R[i] } }
                if (rs) {
                        if ((i = ".Install Path") in _[p] && (i = ".Product 
Version") in _[p]) {
                                _[p]["STATUS"] = "PRESENT"
@@ -2649,9 +2647,8 @@ function _ffaccr(A, t, p, P)
 ##################
 function _fframe(A, t, p)
 {
-       #################################################
-       return _fframe_i0(A, t, p, A[""])
        #_______________________________________________________________________
+       return _fframe_i0(A, t, p, A[""])       
#################################################
 }
 
 #___________________________________________________________
@@ -3149,8 +3146,7 @@ function _getchrln(s, w)
        #################################################
        if (s == "") {
                return 
-       }
-       #if ( w!=w+0 || w<0 )   w=_CON_WIDTH
+       }       #if ( w!=w+0 || w<0 )   w=_CON_WIDTH
        if (length(s) < w) {
                if (s in _GETCHRLN) {
                        if (length(_getchrlnt0 = _GETCHRLN[s]) >= w) {
@@ -4383,12 +4379,12 @@ function _qstrq(t)
 ################################################################
 function _rEG(c, t, P, a, A)
 {
-       #####################################################
+       
#_____________________________________________________________________________
        switch (c) {
        case "_lib_CMDLN":
-               #___________________________________________________________
+               #####################################################
                return t
-               
#_____________________________________________________________________________
+               #___________________________________________________________
                #_____________________________________________________
        case "_lib_APPLY":
                return 
@@ -4436,11 +4432,10 @@ function _rFCHLD(p)
 ######################## p="", !v
 function _rLBRO(p)
 {
-       ######################################################
-       if (p) {
+       #_______________________________________________________________________
+       if (p) {        ######################################################
                if (p in _tPARENT) {
                        return _tLCHLD[_tPARENT[p]]
-                       
#_______________________________________________________________________
                }
                while (p in _tNEXT) {
                        p = _tNEXT[p]
@@ -4453,10 +4448,9 @@ function _rLBRO(p)
 ######################## p=""
 function _rLCHLD(p)
 {
-       #####################################################
-       if (p && p in _tLCHLD) {
+       #_______________________________________________________________________
+       if (p && p in _tLCHLD) {        
#####################################################
                return _tLCHLD[p]
-               
#_______________________________________________________________________
        }
        return ""
 }
@@ -4471,10 +4465,9 @@ function _rLINK(p)
 ######################## p=""
 function _rNEXT(p)
 {
-       ######################################################
-       if (p && p in _tNEXT) {
+       #_______________________________________________________________________
+       if (p && p in _tNEXT) { 
######################################################
                return _tNEXT[p]
-               
#_______________________________________________________________________
        }
        return ""
 }
@@ -4482,10 +4475,9 @@ function _rNEXT(p)
 ######################## p=""
 function _rPARENT(p)
 {
-       ####################################################
-       if (p && p in _tPARENT) {
+       #_______________________________________________________________________
+       if (p && p in _tPARENT) {       
####################################################
                return _tPARENT[p]
-               
#_______________________________________________________________________
        }
        return ""
 }
@@ -4493,10 +4485,9 @@ function _rPARENT(p)
 ######################## p=""
 function _rPREV(p)
 {
-       ######################################################
-       if (p && p in _tPREV) {
+       #_______________________________________________________________________
+       if (p && p in _tPREV) { 
######################################################
                return _tPREV[p]
-               
#_______________________________________________________________________
        }
        return ""
 }
@@ -4504,11 +4495,10 @@ function _rPREV(p)
 ######################## p=""
 function _rQBRO(p, c, p1)
 {
-       ################################################
-       if (p) {
+       #_______________________________________________________________________
+       if (p) {        ################################################
                if (p in _tPARENT) {
                        return _tQCHLD[_tPARENT[p]]
-                       
#_______________________________________________________________________
                }
                c = 1
                p1 = p
@@ -4528,10 +4518,9 @@ function _rQBRO(p, c, p1)
 ######################## p=""
 function _rQCHLD(p)
 {
-       #####################################################
-       if (p && p in _tQCHLD) {
+       #_______________________________________________________________________
+       if (p && p in _tQCHLD) {        
#####################################################
                return _tQCHLD[p]
-               
#_______________________________________________________________________
        }
        return ""
 }
@@ -5155,12 +5144,12 @@ function _rxpfn(R, t, p, i, f, A)
 ##############################################################
 function _sHARE(c, t, P, a, A)
 {
-       ###################################################
+       
#_____________________________________________________________________________
        switch (c) {
        case "_lib_CMDLN":
-               #___________________________________________________________
+               ###################################################
                return t
-               
#_____________________________________________________________________________
+               #___________________________________________________________
                #_____________________________________________________
        case "_lib_APPLY":
                return 
@@ -5182,12 +5171,12 @@ function _sHARE(c, t, P, a, A)
 ################################################################
 function _sYS(c, t, P, a, A)
 {
-       #####################################################
+       
#_____________________________________________________________________________
        switch (c) {
        case "_lib_CMDLN":
-               #___________________________________________________________
+               #####################################################
                return t
-               
#_____________________________________________________________________________
+               #___________________________________________________________
                #_____________________________________________________
        case "_lib_APPLY":
                return 
@@ -5248,8 +5237,7 @@ function _setmpath(p, a)
        if (p && (a = _filerd(p))) {
                if (_FILEIO_TMPRD) {
                        _FILEIO_TMPATHS[_FILEIO_TMPRD]
-               }
-               #if ( _filexist(a) ) _del(a)
+               }               #if ( _filexist(a) ) _del(a)
                #_cmd("rd " a " /S /Q 2>NUL"); _cmd("del " a " /Q 2>NUL")
                return (_FILEIO_TMPRD = a)
        } else {
@@ -5315,11 +5303,9 @@ function _shortcut(D, S)
        if (isarray(D)) {
                if (isarray(S)) {
                        _addarrmask(D, S, _SHORTCUTWSTRUC)
-               } else if (S == 0 && S == "") {
-                       # array,array2*         - copy from array2 to array 
shorcut-specific elements
+               } else if (S == 0 && S == "") { # array,array2*         - copy 
from array2 to array shorcut-specific elements
                        _addarrmask(D, _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
-               } else if (_isnotfileptr(S)) {
-                       # array*                        - define 
shortcut-specific elements in array by default values
+               } else if (_isnotfileptr(S)) {  # array*                        
- define shortcut-specific elements in array by default values
                        _addarrmask(D, _[S], _SHORTCUTWSTRUC)
                } else if (_rd_shortcut(D, S)) {
                        return  # array,ptr*            - copy from array 
_[ptr] to array shorcut-specific elements
@@ -5330,17 +5316,14 @@ function _shortcut(D, S)
        } else if (_isnotfileptr(D)) {
                if (isarray(S)) {
                        _addarrmask(_[D], S, _SHORTCUTWSTRUC)
-               } else if (S == 0 && S == "") {
-                       # ptr,array*            - copy from array to array 
_[ptr] shorcut-specific elements
+               } else if (S == 0 && S == "") { # ptr,array*            - copy 
from array to array _[ptr] shorcut-specific elements
                        _addarrmask(_[D], _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
-               } else if (_isnotfileptr(S)) {
-                       # ptr*                  - define shortcut-specifc 
elements in array _[ptr] by default values
+               } else if (_isnotfileptr(S)) {  # ptr*                  - 
define shortcut-specifc elements in array _[ptr] by default values
                        _addarrmask(_[D], _[S], _SHORTCUTWSTRUC)
                } else if (_rd_shortcut(_[D], S)) {
                        return  # ptr,ptr2*                     - copy from 
array _[ptr2] to array _[ptr] shorcut-specific elements
                }
-       } else {
-               # ptr,filepath*         - define in array _[ptr] 
shortcut-specific elements by reading its from shortcut file filepath(load 
shortcut)
+       } else {        # ptr,filepath*         - define in array _[ptr] 
shortcut-specific elements by reading its from shortcut file filepath(load 
shortcut)
                if (isarray(S) && _wr_shortcut(D, S)) {
                        return  # filepath,array*               - [over]write 
shorcut file filepath; shortcut parameters will be defined by shortcut-specific 
elements in array(save shortcut)
                } else if (S == 0 && S == "" && _wr_shortcut(D, 
_SHORTCUTDEFAULT)) {
@@ -5349,9 +5332,7 @@ function _shortcut(D, S)
                        return  # filepath,ptr*         - [over]write shorcut 
file filepath; shortcut parameters will be defined by shortcut-specific 
elements in array _[ptr](save shortcut)
                } else if (_rd_shortcut(_SHRTCUTA1, S) || _wr_shortcut(D, 
_SHRTCUTA1)) {
                        return 
-               }
-       }
-       # filepath,filepath2*   - [over]write shorcut file filepath; shortcut 
parameters will be defined from shortcut file filepath2(copy shortcut)
+               }       }       # filepath,filepath2*   - [over]write shorcut 
file filepath; shortcut parameters will be defined from shortcut file 
filepath2(copy shortcut)
        return 1
 }
 
@@ -7459,8 +7440,7 @@ function _wFBRO(p, v, a)
                                if ((a = _tPARENT[a]) == v) {
                                        return v
                                }
-                       }
-                       ######################## v is parentesis of p
+                       }       ######################## v is parentesis of p
                        if (p in _tPARENT) {
                                p = _tPARENT[p]
                                if (v in _tNEXT) {
@@ -7550,12 +7530,10 @@ function _wFBRO(p, v, a)
                } else {
                        if (v == 0) {
                                return v
-                       }
-                       ######################## p=ptr, v=0
+                       }                       ######################## p=ptr, 
v=0
                        return v
                }
-       } else {
-               ######################## p=ptr, v=""
+       } else {        ######################## p=ptr, v=""
                if (p == 0) {
                        return v        ######################## p=0
                }
@@ -7574,14 +7552,12 @@ function _wFCHLD(p, v, a)
                if (v) {
                        if (p == v) {
                                return v
-                       }
-                       ######################## p=v=ptr
+                       }                       ######################## p=v=ptr
                        for (a = p; a in _tPARENT; ) {
                                if ((a = _tPARENT[a]) == v) {
                                        return v
                                }
-                       }
-                       ######################## v is parentesis of p
+                       }       ######################## v is parentesis of p
                        if (v in _tNEXT) {
                                if (v in _tPREV) {
                                        _tPREV[_tNEXT[a] = _tNEXT[v]] = a = 
_tPREV[v]
@@ -7636,8 +7612,7 @@ function _wFCHLD(p, v, a)
                        return (_tFCHLD[_tPARENT[v] = p] = _tLCHLD[p] = v)
                } else {
                        if (v == 0) {
-                               if (p in _tFCHLD) {
-                                       ######################## p=ptr, v=0 > 
delete all chld
+                               if (p in _tFCHLD) {     
######################## p=ptr, v=0 > delete all chld
                                        v = _tFCHLD[p]
                                        delete _tFCHLD[p]
                                        delete _tLCHLD[p]
@@ -7649,8 +7624,7 @@ function _wFCHLD(p, v, a)
                        }
                        return v
                }
-       } else {
-               ######################## p=ptr, v="" > ignore action
+       } else {        ######################## p=ptr, v="" > ignore action
                if (p == 0) {
                        return v        ######################## p=0
                }
@@ -7668,8 +7642,7 @@ function _wLBRO(p, v, a)
                                if ((a = _tPARENT[a]) == v) {
                                        return v
                                }
-                       }
-                       ######################## v is parentesis of p
+                       }       ######################## v is parentesis of p
                        if (p in _tPARENT) {
                                p = _tPARENT[p]
                                if (v in _tPREV) {
@@ -7759,12 +7732,10 @@ function _wLBRO(p, v, a)
                } else {
                        if (v == 0) {
                                return v
-                       }
-                       ######################## p=ptr, v=0
+                       }                       ######################## p=ptr, 
v=0
                        return v
                }
-       } else {
-               ######################## p=ptr, v=""
+       } else {        ######################## p=ptr, v=""
                if (p == 0) {
                        return v        ######################## p=0
                }
@@ -7783,14 +7754,12 @@ function _wLCHLD(p, v, a)
                if (v) {
                        if (p == v) {
                                return v
-                       }
-                       ######################## p=v=ptr
+                       }                       ######################## p=v=ptr
                        for (a = p; a in _tPARENT; ) {
                                if ((a = _tPARENT[a]) == v) {
                                        return v
                                }
-                       }
-                       ######################## v is parentesis of p
+                       }       ######################## v is parentesis of p
                        if (v in _tPREV) {
                                if (v in _tNEXT) {
                                        _tNEXT[_tPREV[a] = _tPREV[v]] = a = 
_tNEXT[v]
@@ -7845,8 +7814,7 @@ function _wLCHLD(p, v, a)
                        return (_tLCHLD[_tPARENT[v] = p] = _tFCHLD[p] = v)
                } else {
                        if (v == 0) {
-                               if (p in _tFCHLD) {
-                                       ######################## p=ptr, v=0 > 
delete all chld
+                               if (p in _tFCHLD) {     
######################## p=ptr, v=0 > delete all chld
                                        v = _tFCHLD[p]
                                        delete _tFCHLD[p]
                                        delete _tLCHLD[p]
@@ -7858,8 +7826,7 @@ function _wLCHLD(p, v, a)
                        }
                        return v
                }
-       } else {
-               ######################## p=ptr, v="" > ignore action
+       } else {        ######################## p=ptr, v="" > ignore action
                if (p == 0) {
                        return v        ######################## p=0
                }
@@ -7882,14 +7849,12 @@ function _wNEXT(p, v, a, b)
                if (v) {
                        if (p == v) {
                                return v
-                       }
-                       ######################## p=v=ptr
+                       }                       ######################## p=v=ptr
                        for (a = p; a in _tPARENT; ) {
                                if ((a = _tPARENT[a]) == v) {
                                        return v
                                }
-                       }
-                       ######################## v is parentesis of p
+                       }       ######################## v is parentesis of p
                        if (v in _tPREV) {
                                if (p == (a = _tPREV[v])) {
                                        return v
@@ -7937,12 +7902,10 @@ function _wNEXT(p, v, a, b)
                } else {
                        if (v == 0) {
                                return v
-                       }
-                       ######################## p=ptr, v=0
+                       }                       ######################## p=ptr, 
v=0
                        return v
                }
-       } else {
-               ######################## p=ptr, v=""
+       } else {        ######################## p=ptr, v=""
                if (p == 0) {
                        return v        ######################## p=0
                }
@@ -7968,14 +7931,12 @@ function _wPREV(p, v, a, b)
                if (v) {
                        if (p == v) {
                                return v
-                       }
-                       ######################## p=v=ptr
+                       }                       ######################## p=v=ptr
                        for (a = p; a in _tPARENT; ) {
                                if ((a = _tPARENT[a]) == v) {
                                        return v
                                }
-                       }
-                       ######################## v is parentesis of p
+                       }       ######################## v is parentesis of p
                        if (v in _tNEXT) {
                                if (p == (a = _tNEXT[v])) {
                                        return v
@@ -8023,12 +7984,10 @@ function _wPREV(p, v, a, b)
                } else {
                        if (v == 0) {
                                return v
-                       }
-                       ######################## p=ptr, v=0
+                       }                       ######################## p=ptr, 
v=0
                        return v
                }
-       } else {
-               ######################## p=ptr, v=""
+       } else {        ######################## p=ptr, v=""
                if (p == 0) {
                        return v        ######################## p=0
                }
@@ -8052,11 +8011,9 @@ function _wQCHLD(p, v)
        #############################################
        if (p) {
                if (v) {
-               } else {
-                       ######################## p=ptr, v=ptr
+               } else {        ######################## p=ptr, v=ptr
                        if (v == 0) {
-                               if (p in _tFCHLD) {
-                                       ######################## p=ptr, v=0 > 
delete all chld
+                               if (p in _tFCHLD) {     
######################## p=ptr, v=0 > delete all chld
                                        v = _tFCHLD[p]
                                        delete _tFCHLD[p]
                                        delete _tLCHLD[p]
@@ -8068,12 +8025,10 @@ function _wQCHLD(p, v)
                        }
                        return v
                }
-       } else {
-               ######################## p=ptr, v="" > ignore action
+       } else {        ######################## p=ptr, v="" > ignore action
                if (p == 0) {
                        return v
-               }
-               ######################## p=0
+               }               ######################## p=0
                return v
        }
 }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          |   23 +++++++
 profile.c          |    7 +-
 test/ChangeLog     |    6 ++
 test/Makefile.am   |    9 +++-
 test/Makefile.in   |    9 +++-
 test/profile10.awk |   39 ++++++++++++
 test/profile10.ok  |   37 +++++++++++
 test/profile5.ok   |  173 +++++++++++++++++++---------------------------------
 8 files changed, 189 insertions(+), 114 deletions(-)
 create mode 100644 test/profile10.awk
 create mode 100644 test/profile10.ok


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]