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
+4 -1
View File
@@ -4,6 +4,7 @@
#include <bshell/runtime/cmdcall.h>
#include <bshell/runtime/pipeline.h>
#include <bshell/runtime/runtime.h>
#include <bshell/runtime/scope.h>
#include <bshell/status.h>
#include <fx/collections/array.h>
#include <fx/collections/hashtable.h>
@@ -250,7 +251,9 @@ static enum bshell_status eval_instruction(
fx_value_get_cstr(pool_value, &s);
var = bshell_runtime_find_var(rt, s);
if (!var) {
var = bshell_runtime_define_var(rt, s);
var = bshell_runtime_scope_define_variable(
bshell_runtime_get_current_scope(rt),
s);
}
bshell_variable_set_value(var, x);