#include <ecoli_node_seq.h>
#include <ecoli_node_str.h>
#include <ecoli_node_option.h>
#include <ecoli_node_seq.h>
#include <ecoli_node_str.h>
#include <ecoli_node_option.h>
const struct ec_strvec *strvec)
{
struct ec_node_sh_lex *node = (struct ec_node_sh_lex *)gen_node;
struct ec_strvec *new_vec = NULL;
const struct ec_strvec *strvec)
{
struct ec_node_sh_lex *node = (struct ec_node_sh_lex *)gen_node;
struct ec_strvec *new_vec = NULL;
str = ec_strvec_val(strvec, 0);
new_vec = tokenize(str, 0, 0, NULL);
}
str = ec_strvec_val(strvec, 0);
new_vec = tokenize(str, 0, 0, NULL);
}
- } else if (ret != EC_PARSED_NOMATCH) {
- child_parsed = ec_parsed_get_last_child(state);
- ec_parsed_del_child(state, child_parsed);
- ec_parsed_free(child_parsed);
- ret = EC_PARSED_NOMATCH;
+ } else if (ret != EC_PARSE_NOMATCH) {
+ child_parse = ec_parse_get_last_child(state);
+ ec_parse_unlink_child(state, child_parse);
+ ec_parse_free(child_parse);
+ ret = EC_PARSE_NOMATCH;
/* we will store the completions in a temporary struct, because
* we want to update them (ex: add missing quotes) */
/* we will store the completions in a temporary struct, because
* we want to update them (ex: add missing quotes) */
if (ec_asprintf(&new_str, "%c%s%c", missing_quote, str,
missing_quote) < 0) {
new_str = NULL;
goto fail;
}
if (ec_asprintf(&new_str, "%c%s%c", missing_quote, str,
missing_quote) < 0) {
new_str = NULL;
goto fail;
}
if (ec_asprintf(&new_str, "%s%c", str,
missing_quote) < 0) {
new_str = NULL;
goto fail;
}
if (ec_asprintf(&new_str, "%s%c", str,
missing_quote) < 0) {
new_str = NULL;
goto fail;
}
+static size_t
+ec_node_sh_lex_get_children_count(const struct ec_node *gen_node)
+{
+ struct ec_node_sh_lex *node = (struct ec_node_sh_lex *)gen_node;
+
+ if (node->child)
+ return 1;
+ return 0;
+}
+
+static struct ec_node *
+ec_node_sh_lex_get_child(const struct ec_node *gen_node, size_t i)
+{
+ struct ec_node_sh_lex *node = (struct ec_node_sh_lex *)gen_node;
+
+ if (i >= 1)
+ return NULL;
+
+ return node->child;
+}
+
static struct ec_node_type ec_node_sh_lex_type = {
.name = "sh_lex",
.parse = ec_node_sh_lex_parse,
.complete = ec_node_sh_lex_complete,
.size = sizeof(struct ec_node_sh_lex),
.free_priv = ec_node_sh_lex_free_priv,
static struct ec_node_type ec_node_sh_lex_type = {
.name = "sh_lex",
.parse = ec_node_sh_lex_parse,
.complete = ec_node_sh_lex_complete,
.size = sizeof(struct ec_node_sh_lex),
.free_priv = ec_node_sh_lex_free_priv,