EC_PNODE_DEL_LAST_CHILD(3)

πŸ’– EC_PNODE_DEL_LAST_CHILD πŸ’–

okay bestie, welcome to the Libecoli Programmer's Manual ✨ you're literally about to learn how to yeet the last child of a parse node and I'm so excited for you 🫢


✨ NAME ✨

ec_pnode_del_last_child β€” unlink and free the last child. that's it. that's the whole job. πŸ’…


🌸 SYNOPSIS 🌸

#include <ecoli/parse.h>

void ec_pnode_del_last_child(
    /*
     * A node in the parsing tree which has at least one child.
     */
    struct ec_pnode   *pnode
);

so you're passing in one thing, <lavender>pnode</lavender>, and it's a node in the parsing tree which has at least one child β€” read that comment again bestie, it's important, the node needs at least one child or this whole situation is giving 🚫. and the return type is void β€” nothing comes back, no cap, she just does the thing and dips 😌


πŸŽ€ DESCRIPTION πŸŽ€

okay so picture this: it's a shortcut. a little one-liner moment. it unlinks and frees the last child of a node. done. iconic. πŸ‘‘

and why would you even want that? because it is a quite common operation in intermediate nodes β€” think ec_node_seq(), ec_node_many(), and friends β€” where the vibe is: you temporarily added a subtree during the completion process, and now the moment has passed and you need to remove that subtree 🧹✨ it's the cleanup era. it's giving spring cleaning. it's giving "not me leaving a dangling subtree in the tree πŸ™ˆ".

so yeah: temporary subtree goes in, temporary subtree comes out, everyone moves on πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, fr fr β€” go read these too:


Copyright (C) 2010-2026 Olivier Matz, Robin Jarry. 🫢


and that's the whole page bestie, you ate that πŸ’… the manual name is EC_PNODE_...LAST_CHILD(3) (it's a long one, she's mysterious), it shipped from libecoli dated 2026-06-11, and it's been serving parse-tree realness since 2010 πŸ’– k bye, go free some children (the pointer kind, obviously) πŸŒˆβ­πŸ¦‹

πŸ“¦ where this page comes from