From ec4a2c23d7ebe26ef913d71bb2cd0a3f89ffe8fd Mon Sep 17 00:00:00 2001 From: Tachikoma Date: Wed, 5 Aug 2026 11:49:45 -0400 Subject: [PATCH] Add doxygen block for environment_create_named Andrew flagged the new helper introduced for the value-pool-leak fix as missing documentation. akbasic_environment_create() and akbasic_environment_create_empty() are already documented in the header; the shared static helper they both call was the only undocumented new function definition. Co-authored-by: andrew --- src/environment.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/environment.c b/src/environment.c index 27ac19d..b2bdc9b 100644 --- a/src/environment.c +++ b/src/environment.c @@ -306,6 +306,21 @@ akerr_ErrorContext *akbasic_environment_get(akbasic_Environment *obj, const char SUCCEED_RETURN(errctx); } +/** + * @brief Create a variable slot in the given scope, optionally allocating its storage. + * + * Shared by akbasic_environment_create() and akbasic_environment_create_empty(), + * which differ only in whether the new variable's value storage is initialized + * immediately or left for the caller to set up. + * + * @param obj Scope the variable is created in; only this scope is searched or + * written to, unlike akbasic_environment_get()'s walk up the parent chain. + * @param varname Name of the variable to create. + * @param dest Set to the created (or already-existing) variable. + * @param initialize When true, the variable's value storage is allocated from + * the runtime's value pool; when false, the caller must initialize it + * before the variable is evaluated. + */ static akerr_ErrorContext *environment_create_named(akbasic_Environment *obj, const char *varname, akbasic_Variable **dest, bool initialize) {