diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2022-04-21 17:26:21 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2022-04-21 17:26:21 +0300 |
commit | 6cf92b53d37c1f9e3029cb1c8c0217100c7e36d8 (patch) | |
tree | db9fc3d394519563ce81129911088aeef9992e55 /profile.c | |
parent | 2b4d1c796f24d1fc2fb09bd1570f859caabda419 (diff) | |
download | gawk-6cf92b53d37c1f9e3029cb1c8c0217100c7e36d8.tar.gz |
Pretty printing improvements for comments in switch/case.
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -998,9 +998,11 @@ cleanup: fprintf(prof_fp, "%s (", op2str(pc->opcode)); pprint(pc->nexti, ip1->switch_start, NO_PPRINT_FLAGS); t1 = pp_pop(); - fprintf(prof_fp, "%s) {\n", t1->pp_str); + fprintf(prof_fp, "%s) {", t1->pp_str); if (pc->comment) print_comment(pc->comment, 0); + else + fprintf(prof_fp, "\n"); pp_free(t1); pprint(ip1->switch_start, ip1->switch_end, NO_PPRINT_FLAGS); indent(SPACEOVER); @@ -1022,9 +1024,11 @@ cleanup: indent_in(); if (pc->comment != NULL) { - if (pc->comment->memory->comment_type == EOL_COMMENT) + if (pc->comment->memory->comment_type == EOL_COMMENT) { fprintf(prof_fp, "\t%s", pc->comment->memory->stptr); - else { + if (pc->comment->comment != NULL) + print_comment(pc->comment->comment, indent_level); + } else { fprintf(prof_fp, "\n"); print_comment(pc->comment, indent_level); } |