add nil stuff
This commit is contained in:
parent
9038939bd1
commit
0fad63f22a
2
Makefile
2
Makefile
|
@ -1,7 +1,7 @@
|
|||
all: build run
|
||||
|
||||
build:
|
||||
gcc -o bin/picrin -I./include src/main.c src/state.c
|
||||
gcc -o bin/picrin -I./include src/main.c src/state.c src/gc.c
|
||||
|
||||
clean:
|
||||
rm bin/picrin
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define VALUE_H__
|
||||
|
||||
enum pic_vtype {
|
||||
PIC_VTYPE_NIL,
|
||||
PIC_VTYPE_HEAP
|
||||
};
|
||||
|
||||
|
@ -35,6 +36,7 @@ struct pic_symbol {
|
|||
char *name;
|
||||
};
|
||||
|
||||
pic_value pic_nil_value();
|
||||
pic_value pic_obj_value(struct pic_object *obj);
|
||||
|
||||
#endif
|
||||
|
|
10
src/value.c
10
src/value.c
|
@ -1,5 +1,15 @@
|
|||
#include "picrin.h"
|
||||
|
||||
pic_value
|
||||
pic_nil_value()
|
||||
{
|
||||
pic_value v;
|
||||
|
||||
v.vtype = PIC_VTYPE_NIL;
|
||||
v.u.data = NULL;
|
||||
return v;
|
||||
}
|
||||
|
||||
pic_value
|
||||
pic_obj_value(struct pic_object *obj)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue