ecoli_node_once(3)

πŸ“¦
version 0.11.3 Β· 2 versions
, in epel 9

πŸ’… ecoli_node_once(3) β€” the Libecoli manual, bestie edition πŸŽ€

okay so real quick, this is a page from Libecoli, manual section 3, and it's about ecoli_node_once β€” the Once node. yes, the name is literally the whole vibe. let's get into it ✨


🌸 NAME 🌸

ecoli_node_once β€” Once node

  • A node that prevents its child from being parsed more than once. 🫢

that's it. that's the pitch. lowkey iconic.


✨ SYNOPSIS ✨

Functions

struct ec_node * ec_node_once (const char *id, struct ec_node *child)
int ec_node_once_set_child (struct ec_node *node, struct ec_node *child)

two functions, that's the whole roster. slay πŸ’…


πŸ¦‹ Detailed Description πŸ¦‹

A node that prevents its child from being parsed more than once. fr fr, that's the entire personality β€” it wraps your child node and makes sure the parser doesn't come back for seconds.

πŸŽ€ Configuration Schema πŸŽ€

here's the schema, verbatim, no cap:

schema once {
    node child  {
        description "The child node.";
    }
}

so the one thing it's got going on config-wise is child, and the description literally just says it's the child node. minimal. main character energy. πŸ‘‘


πŸ’– Function Documentation πŸ’–

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

This node behaves like its child, but prevents it from being parsed more than once. like, it is the child, but with boundaries. 🚧

Example β€” here's the exact snippet:

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

Matches: [], ['foo', 'bar'], ['bar', 'bar'], ['foo', 'bar', 'bar'], ...

But not: ['foo', 'foo'], ['foo', 'bar', 'foo'], ...

see how foo never shows up twice? that's the once node doing its little job. 🧚

⚠️ heads up: on error, the child is not freed. so don't go assuming it got cleaned up for you, bestie β€” that leak is on you. πŸ’€

🌸 int ec_node_once_set_child (struct ec_node * node, struct ec_node * child)

Set the child of a once node.

⚠️ and yeah, this one's different: on error, the child is freed. opposite energy from the constructor above. don't mix 'em up. πŸ™ˆ

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Libecoli from the source code. so nobody hand-wrote this, the robots did it, and honestly? they ate. πŸ€–βœ¨


and that's the page!! πŸ’œ it's Libecoli Version 0.11.3, dated Thu Apr 9 2026 β€” mwah, go parse something responsibly, bestie πŸ“πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from