Commit 4192722444b91b7574815fba86d3f064a77f355c

Thomas de Grivel 2023-03-13T16:49:54

wip buf_parse_call_op

diff --git a/libc3/env.c b/libc3/env.c
index 09229b3..4740ab7 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -425,6 +425,7 @@ s_env * env_init (s_env *env)
   buf_init_alloc(&env->err, BUF_SIZE);
   buf_file_open_w(&env->err, stderr);
   facts_init(&env->facts);
+  /* TODO: module path */
   if (! access("lib/c3/0.1", X_OK))
     str_init_1(&env->module_path, NULL, "lib/c3/0.1");
   else if (! access("../lib/c3/0.1", X_OK))
diff --git a/libc3/facts_with_cursor.c b/libc3/facts_with_cursor.c
index f3d61b2..2d260cf 100644
--- a/libc3/facts_with_cursor.c
+++ b/libc3/facts_with_cursor.c
@@ -43,7 +43,7 @@ s_fact * facts_with_cursor_next (s_facts_with_cursor *cursor)
     return NULL;
   if (cursor->level == cursor->facts_count) {
     level = &cursor->levels[cursor->facts_count - 1];
-#ifdef DEBUG
+#ifdef DEBUG_FACTS
     buf_write_1(&g_c3_env.err, "[debug] cursor->level=");
     buf_inspect_u64(&g_c3_env.err, cursor->level);
     buf_write_1(&g_c3_env.err, " level->spec=");
@@ -52,7 +52,7 @@ s_fact * facts_with_cursor_next (s_facts_with_cursor *cursor)
     buf_inspect_fact(&g_c3_env.err, level->fact);
 #endif
     level->fact = facts_cursor_next(&level->cursor);
-#ifdef DEBUG
+#ifdef DEBUG_FACTS
     buf_write_1(&g_c3_env.err, " -> ");
     buf_inspect_fact(&g_c3_env.err, level->fact);
     buf_write_1(&g_c3_env.err, "\n");
@@ -81,7 +81,7 @@ s_fact * facts_with_cursor_next (s_facts_with_cursor *cursor)
                       level->spec[0], level->spec[1],
                       level->spec[2]);
     }
-#ifdef DEBUG
+#ifdef DEBUG_FACTS
     buf_write_1(&g_c3_env.err, "[debug] cursor->level=");
     buf_inspect_u64(&g_c3_env.err, cursor->level);
     buf_write_1(&g_c3_env.err, " level->spec=");
@@ -91,7 +91,7 @@ s_fact * facts_with_cursor_next (s_facts_with_cursor *cursor)
 #endif
     fact = facts_cursor_next(&level->cursor);
     level->fact = fact;
-#ifdef DEBUG
+#ifdef DEBUG_FACTS
     buf_write_1(&g_c3_env.err, " -> ");
     buf_inspect_fact(&g_c3_env.err, level->fact);
     buf_write_1(&g_c3_env.err, "\n");