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-1708-g3e92d06
Date: Mon, 21 Mar 2016 03:36:56 +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  3e92d06bebd53eba773749351641e3eaed7c117f (commit)
      from  dd0cfe0cb3138755733c6578366cebc239e7017d (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=3e92d06bebd53eba773749351641e3eaed7c117f

commit 3e92d06bebd53eba773749351641e3eaed7c117f
Author: Arnold D. Robbins <address@hidden>
Date:   Mon Mar 21 05:36:33 2016 +0200

    Improve pretty-printing comment after if statement.

diff --git a/ChangeLog b/ChangeLog
index fcb9a2a..5d16910 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-21         Arnold D. Robbins     <address@hidden>
+
+       * profile.c (pprint): Improve handling of comment after
+       and if statement without an else.
+
 2016-03-19         Arnold D. Robbins     <address@hidden>
 
        Considerable improvements to handling of comments when pretty
diff --git a/profile.c b/profile.c
index b679719..3eca03b 100644
--- a/profile.c
+++ b/profile.c
@@ -932,7 +932,8 @@ cleanup:
                        if (pc->nexti->opcode == Op_no_op) {    /* no following 
else */
                                indent(SPACEOVER);
                                fprintf(prof_fp, "}");
-                               if (pc->nexti->nexti->opcode != Op_comment)
+                               if (pc->nexti->nexti->opcode != Op_comment
+                                   || pc->nexti->nexti->memory->comment_type 
== FULL_COMMENT)
                                        fprintf(prof_fp, "\n");
                                /* else
                                        It will be printed at the top. */
diff --git a/test/ChangeLog b/test/ChangeLog
index edacd49..c5536f0 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2016-03-21         Arnold D. Robbins     <address@hidden>
+
+       * profile5.ok, profile10.awk, profile10.ok: Adjust after code changes.
+
 2016-03-19         Arnold D. Robbins     <address@hidden>
 
        * profile5.ok: Adjust after code changes.
diff --git a/test/profile10.awk b/test/profile10.awk
index 3bb2947..b78ae44 100644
--- a/test/profile10.awk
+++ b/test/profile10.awk
@@ -34,6 +34,9 @@ BEGIN {                       # Comment 0
                print "foo"
        }               # Comment 25
 
+       if (2) {
+               print "bar"
+       }
        # Comment 26
 }
 # Comment 27
diff --git a/test/profile10.ok b/test/profile10.ok
index 9d4840c..13f0b67 100644
--- a/test/profile10.ok
+++ b/test/profile10.ok
@@ -31,6 +31,9 @@ BEGIN {       # Comment 0
        if (1) {
                print "foo"
        }       # Comment 25
+       if (2) {
+               print "bar"
+       }
        # Comment 26
 }
 
diff --git a/test/profile5.ok b/test/profile5.ok
index 602702c..1ffaf43 100644
--- a/test/profile5.ok
+++ b/test/profile5.ok
@@ -3146,7 +3146,8 @@ 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) {
@@ -5237,7 +5238,8 @@ 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 {

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

Summary of changes:
 ChangeLog          |    5 +++++
 profile.c          |    3 ++-
 test/ChangeLog     |    4 ++++
 test/profile10.awk |    3 +++
 test/profile10.ok  |    3 +++
 test/profile5.ok   |    6 ++++--
 6 files changed, 21 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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