runtime: move variable definition from runtime to individual scopes
This commit is contained in:
@@ -32,9 +32,6 @@ extern fx_value bshell_runtime_eval_script(
|
||||
extern bshell_variable *bshell_runtime_find_var(
|
||||
struct bshell_runtime *rt,
|
||||
const char *name);
|
||||
extern bshell_variable *bshell_runtime_define_var(
|
||||
struct bshell_runtime *rt,
|
||||
const char *name);
|
||||
extern enum bshell_status bshell_runtime_define_function(
|
||||
struct bshell_runtime *rt,
|
||||
bshell_function *func);
|
||||
@@ -49,6 +46,8 @@ extern enum bshell_status bshell_runtime_push_scope(
|
||||
extern enum bshell_status bshell_runtime_pop_scope(struct bshell_runtime *rt);
|
||||
extern fx_value bshell_runtime_eval(struct bshell_runtime *rt);
|
||||
|
||||
extern struct bshell_runtime_scope *bshell_runtime_get_global_scope(
|
||||
struct bshell_runtime *rt);
|
||||
extern struct bshell_runtime_scope *bshell_runtime_get_current_scope(
|
||||
struct bshell_runtime *rt);
|
||||
extern struct bshell_runtime_scope *bshell_runtime_get_parent_scope(
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
#ifndef BSHELL_RUNTIME_SCOPE_H_
|
||||
#define BSHELL_RUNTIME_SCOPE_H_
|
||||
|
||||
#include <bshell/runtime/var.h>
|
||||
#include <fx/collections/hashtable.h>
|
||||
|
||||
struct bshell_runtime_scope;
|
||||
|
||||
extern fx_hashtable *bshell_runtime_scope_get_functions(
|
||||
struct bshell_runtime_scope *scope);
|
||||
extern bshell_variable *bshell_runtime_scope_define_variable(
|
||||
struct bshell_runtime_scope *scope,
|
||||
const char *name);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user