runtime: move variable definition from runtime to individual scopes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user