41 lines
581 B
C
41 lines
581 B
C
|
|
#include <assert.h>
|
|
|
|
#include <debug.h>
|
|
|
|
#include <avl/avl.h>
|
|
|
|
#include "../struct.h"
|
|
|
|
#include "variable/new.h"
|
|
|
|
#include "struct.h"
|
|
#include "define.h"
|
|
|
|
void environment_value_define(
|
|
struct value* super,
|
|
struct string* name,
|
|
struct value* value)
|
|
{
|
|
ENTER;
|
|
|
|
assert(super->kind == vk_envrionment);
|
|
|
|
struct environment_value* this = &super->subclass.environment;
|
|
|
|
struct variable* variable = new_variable(name, value);
|
|
|
|
void* ptr = avl_insert(this->tree, variable);
|
|
|
|
if (!ptr)
|
|
{
|
|
TODO;
|
|
}
|
|
|
|
EXIT;
|
|
}
|
|
|
|
|
|
|
|
|
|
|