From c396da4f41d58b19c555459802197c8c9816c2d5 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Thu, 3 Aug 2017 22:30:44 +0200 Subject: [PATCH] parsed --- lib/ecoli_parsed.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/ecoli_parsed.c b/lib/ecoli_parsed.c index e3a05e9..c717723 100644 --- a/lib/ecoli_parsed.c +++ b/lib/ecoli_parsed.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -200,19 +201,7 @@ static void __ec_parsed_dump(FILE *out, fprintf(out, "node_type=%s id=%s vec=", typename, id); vec = ec_parsed_strvec(parsed); - if (vec == NULL) { - fprintf(out, "none\n"); - } else { - for (i = 0; i < ec_strvec_len(vec); i++) - fprintf(out, "%s<%s>", - i == 0 ? "" : ",", - ec_strvec_val(vec, i)); - // XXX - if (!strcmp(typename, "int") || !strcmp(typename, "str")) - fprintf(out, "] <<<<<\n"); - else - fprintf(out, "]\n"); - } + ec_strvec_dump(out, vec); TAILQ_FOREACH(child, &parsed->children, next) __ec_parsed_dump(out, child, indent + 2); @@ -241,7 +230,7 @@ void ec_parsed_add_child(struct ec_parsed *parsed, child->parent = parsed; } -void ec_parsed_del_child(struct ec_parsed *parsed, +void ec_parsed_del_child(struct ec_parsed *parsed, // XXX rename del in unlink? struct ec_parsed *child) { TAILQ_REMOVE(&parsed->children, child, next); @@ -254,7 +243,7 @@ ec_parsed_get_last_child(struct ec_parsed *parsed) return TAILQ_LAST(&parsed->children, ec_parsed_list); } -void ec_parsed_del_last_child(struct ec_parsed *parsed) +void ec_parsed_del_last_child(struct ec_parsed *parsed) // rename in free { struct ec_parsed *child; -- 2.39.5