aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-07-30 14:26:50 -0400
committerArnold D. Robbins <arnold@skeeve.com>2013-08-14 00:00:19 +0300
commitafc5c481f97b85b803b9b973d52684deceb715d0 (patch)
treea0915082f5e3d2e8a8a8fafba3d0ee160e362417 /profile.c
parent15a922b8a62092fab8b0e9b9fa06c3182b38b596 (diff)
downloadegawk-afc5c481f97b85b803b9b973d52684deceb715d0.tar.gz
egawk-afc5c481f97b85b803b9b973d52684deceb715d0.tar.bz2
egawk-afc5c481f97b85b803b9b973d52684deceb715d0.zip
Start new branch that adds comments to profiling.
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/profile.c b/profile.c
index eae24b1c..5c7555e6 100644
--- a/profile.c
+++ b/profile.c
@@ -873,6 +873,28 @@ cleanup:
indent(pc->exec_count);
break;
+ case Op_comment:
+ {
+ char *text;
+ size_t count;
+ bool after_newline = false;
+
+ count = pc->memory->stlen;
+ text = pc->memory->stptr;
+
+ indent(SPACEOVER);
+ for (; count > 0; count--, text++) {
+ if (after_newline) {
+ indent(SPACEOVER);
+ after_newline = false;
+ }
+ putc(*text, prof_fp);
+ if (*text == '\n')
+ after_newline = true;
+ }
+ }
+ break;
+
default:
cant_happen();
}