EC_COMP_GET_CUR_PSTATE(3)

πŸ“¦
version 0.11.7 Β· 5 versions
, in fedora 44

πŸ’– EC_COMP_GET_CUR_PSTATE β€” bestie's guide to the current pstate πŸ’–

okay so real talk, this is a page from the Libecoli Programmer's Manual, and it's about one (1) little function that goes hard: ec_comp_get_cur_pstate. ✨


🌸 NAME 🌸

ec_comp_get_cur_pstate β€” get the current parsing state of completion. literally that's the whole gig. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <ecoli/complete.h>

struct ec_pnode * ec_comp_get_cur_pstate(
    const struct ec_comp   *comp   /* The current completion list. */
);

so you include <ecoli/complete.h> and you call it with comp, which is the current completion list. that's the tea. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

bestie, listen. this function is designed to be called by a node during the completion process. like, mid-glow-up. πŸ’«

here's the vibe: when the library is processing the list of completions for a given input, it builds an incomplete parsing tree before the completion callback even gets invoked. and a node can absolutely use that tree if the completions list depends on what was previously parsed. iykyk. 🌈

the iconic example? the ec_node_once() node. it peeks inside the parsing tree to check if the node is already parsed, and if it is β€” no completion is issued. periodt. πŸ‘‘


✨ RETURN VALUE ✨

the current parsing state. and it cannot be NULL β€” so don't even stress about a null check, it's giving reliable. πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, no cap:


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


and that's a wrap on the EC_COMP_GET_CUR_PSTATE(3) page from libecoli, dated 2026-06-11 β€” mwah, slay, go parse something gorgeous. πŸ’…βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from