diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | profile.c | 3 | ||||
-rw-r--r-- | test/ChangeLog | 4 | ||||
-rw-r--r-- | test/profile10.awk | 3 | ||||
-rw-r--r-- | test/profile10.ok | 3 | ||||
-rw-r--r-- | test/profile5.ok | 6 |
6 files changed, 21 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2016-03-21 Arnold D. Robbins <arnold@skeeve.com> + + * profile.c (pprint): Improve handling of comment after + and if statement without an else. + 2016-03-19 Arnold D. Robbins <arnold@skeeve.com> Considerable improvements to handling of comments when pretty @@ -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 edacd493..c5536f01 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2016-03-21 Arnold D. Robbins <arnold@skeeve.com> + + * profile5.ok, profile10.awk, profile10.ok: Adjust after code changes. + 2016-03-19 Arnold D. Robbins <arnold@skeeve.com> * profile5.ok: Adjust after code changes. diff --git a/test/profile10.awk b/test/profile10.awk index 3bb2947d..b78ae447 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 9d4840c2..13f0b67b 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 602702cf..1ffaf438 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 { |