#include <ecoli_node_str.h>
#include <ecoli_test.h>
+EC_LOG_TYPE_REGISTER(node_option);
+
struct ec_node_option {
struct ec_node gen;
struct ec_node *child;
int ret;
ret = ec_node_parse_child(node->child, state, strvec);
+ if (ret < 0)
+ return ret;
+
if (ret == EC_PARSED_NOMATCH)
return 0;
- else if (ret < 0)
- return ret;
return ret;
}
node = ec_node_option(NULL, ec_node_str(NULL, "foo"));
if (node == NULL) {
- ec_log(EC_LOG_ERR, "cannot create node\n");
+ EC_LOG(EC_LOG_ERR, "cannot create node\n");
return -1;
}
ret |= EC_TEST_CHECK_PARSE(node, 1, "foo");
/* test completion */
node = ec_node_option(NULL, ec_node_str(NULL, "foo"));
if (node == NULL) {
- ec_log(EC_LOG_ERR, "cannot create node\n");
+ EC_LOG(EC_LOG_ERR, "cannot create node\n");
return -1;
}
ret |= EC_TEST_CHECK_COMPLETE(node,