From afc5c481f97b85b803b9b973d52684deceb715d0 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 30 Jul 2013 14:26:50 -0400 Subject: Start new branch that adds comments to profiling. --- profile.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'profile.c') 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(); } -- cgit v1.2.3