runtime: move variable definition from runtime to individual scopes

This commit is contained in:
2026-06-20 15:09:10 +01:00
parent c2d3e05430
commit c262b53eab
7 changed files with 42 additions and 28 deletions
+17
View File
@@ -116,3 +116,20 @@ fx_hashtable *bshell_runtime_scope_get_functions(
{
return scope->s_functions;
}
bshell_variable *bshell_runtime_scope_define_variable(
struct bshell_runtime_scope *scope,
const char *name)
{
if (!scope) {
return NULL;
}
bshell_variable *var = bshell_variable_create(name);
if (!var) {
return NULL;
}
var_map_put(&scope->s_vars, var);
return var;
}