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