ec_node_once - Man Page

This node behaves like its child, but prevents it from being parsed more than once.

Synopsis

#include <ecoli/node_once.h>

struct ec_node * ec_node_once(
    const char       *id,
    struct ec_node   *child
);

Description

Example:

many(
  or(
    once(str("foo")),
    str("bar")))

Matches: [], ["foo", "bar"], ["bar", "bar"], ["foo", "bar", "bar"], ... But not: ["foo", "foo"], ["foo", "bar", "foo"], ...

On error, the child is not freed.

See Also

ec_node_once_set_child(3)

Referenced By

ec_node_once_set_child(3).

2026-06-11 Libecoli Programmer's Manual