Changeset: ced38a3b2e7c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ced38a3b2e7c
Modified Files:
monetdb5/mal/mal.h
monetdb5/mal/mal_listing.c
Branch: parappend
Log Message:
Introduce LIST_MAL_NOCOMMENTS
diffs (50 lines):
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -92,7 +92,8 @@ mal_export void mal_reset(void);
#define LIST_MAL_MAPI 32 /* output Mapi compatible output */
#define LIST_MAL_REMOTE 64 /* output MAL for remote execution */
#define LIST_MAL_FLOW 128 /* output MAL dataflow dependencies */
-#define LIST_MAL_CALL (LIST_MAL_NAME | LIST_MAL_VALUE )
+#define LIST_MAL_NOCOMMENTS 256 /* suppress lines starting with '#' */
+#define LIST_MAL_CALL (LIST_MAL_NAME | LIST_MAL_VALUE)
#define LIST_MAL_DEBUG (LIST_MAL_NAME | LIST_MAL_VALUE | LIST_MAL_TYPE |
LIST_MAL_PROPS | LIST_MAL_FLOW)
#define LIST_MAL_ALL (LIST_MAL_NAME | LIST_MAL_VALUE | LIST_MAL_TYPE |
LIST_MAL_MAPI)
diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c
--- a/monetdb5/mal/mal_listing.c
+++ b/monetdb5/mal/mal_listing.c
@@ -351,7 +351,7 @@ instruction2str(MalBlkPtr mb, MalStkPtr
case CMDcall:
case ASSIGNsymbol :
// is any variable explicit or used
- /* this code was meant to make it easy to detect functions
whose
+ /* this code was meant to make it easy to detect functions whose
* result variable was not used anywhere.
* It is not essential
for (i = 0; i < p->retc; i++)
@@ -567,14 +567,19 @@ printInstruction(stream *fd, MalBlkPtr m
if (fd == 0)
return;
ps = instruction2str(mb, stk, p, flg);
- /* ps[strlen(ps)-1] = 0; remove '\n' */
- if ( ps ){
- mnstr_printf(fd, "%s%s", (flg & LIST_MAL_MAPI ? "=" : ""), ps);
+ if (ps && (flg & LIST_MAL_NOCOMMENTS) != 0) {
+ char *hashmark = strchr(ps, '#');
+ if (hashmark) {
+ *hashmark = 0;
+ }
+ }
+ if (ps){
+ if (*ps != '\0')
+ mnstr_printf(fd, "%s%s\n", (flg & LIST_MAL_MAPI ? "=" :
""), ps);
GDKfree(ps);
} else {
- mnstr_printf(fd,"#failed instruction2str()");
+ mnstr_printf(fd,"#failed instruction2str()\n");
}
- mnstr_printf(fd, "\n");
}
void
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list