31 lines
443 B
C
31 lines
443 B
C
|
|
#include <assert.h>
|
|
|
|
#include <debug.h>
|
|
|
|
#include <extern/avl/avl.h>
|
|
|
|
#include "variable/new.h"
|
|
|
|
#include "struct.h"
|
|
#include "declare.h"
|
|
|
|
void environment_declare(
|
|
struct environment* this,
|
|
struct string* name,
|
|
struct value* value)
|
|
{
|
|
ENTER;
|
|
|
|
struct variable* variable = new_variable(name, value);
|
|
|
|
void* node = avl_insert(this->tree, variable);
|
|
|
|
if (!node)
|
|
{
|
|
TODO;
|
|
}
|
|
|
|
EXIT;
|
|
}
|
|
|