diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-10-16 21:09:13 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-10-16 21:09:13 +0300 |
commit | 8848f21e0a2e0223a3963f84cf24aa1bbf4f7e55 (patch) | |
tree | 2b48d30843fdf2c3b523683b42fae9ad8c878129 /profile.c | |
parent | 19ecd045e33ad66f27d859034141ccf09c8032b9 (diff) | |
download | egawk-8848f21e0a2e0223a3963f84cf24aa1bbf4f7e55.tar.gz egawk-8848f21e0a2e0223a3963f84cf24aa1bbf4f7e55.tar.bz2 egawk-8848f21e0a2e0223a3963f84cf24aa1bbf4f7e55.zip |
Continue with comments, especially case and default.
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -246,7 +246,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags) if (rule != Rule) { /* Allow for pre-non-rule-block comment */ - if (pc->nexti != (pc +1)->firsti + if (pc->nexti != (pc+1)->firsti && pc->nexti->opcode == Op_comment && pc->nexti->memory->comment_type == BLOCK_COMMENT) print_comment(pc->nexti, -1); @@ -945,13 +945,19 @@ cleanup: if (pc->opcode == Op_K_case) { t1 = pp_pop(); fprintf(prof_fp, "%s %s:", op2str(pc->opcode), t1->pp_str); - pc = end_line(pc); pp_free(t1); - } else { + } else fprintf(prof_fp, "%s:", op2str(pc->opcode)); - pc = end_line(pc); - } + indent_in(); + if (pc->comment != NULL) { + if (pc->comment->memory->comment_type == EOL_COMMENT) + fprintf(prof_fp, "\t%s", pc->comment->memory->stptr); + else { + fprintf(prof_fp, "\n"); + print_comment(pc->comment, indent_level); + } + } pprint(pc->stmt_start->nexti, pc->stmt_end->nexti, NO_PPRINT_FLAGS); indent_out(); break; |