Revert "reserve the 0 symbol for system use"
This reverts commit 816343bd31
.
Conflicts:
include/picrin/value.h
src/state.c
This commit is contained in:
parent
c10f40acd4
commit
9742689c40
|
@ -11,9 +11,6 @@ extern "C" {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pic_sym is just an alias to unsigned int.
|
* pic_sym is just an alias to unsigned int.
|
||||||
* the value 0 for pic_sym is guaranteed to resolve to no symbol.
|
|
||||||
* if you are defining a function that returns optional<pic_sym>,
|
|
||||||
* the zero symbol would be useful for such situation.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef unsigned pic_sym;
|
typedef unsigned pic_sym;
|
||||||
|
|
|
@ -75,9 +75,6 @@ pic_open(int argc, char *argv[], char **envp)
|
||||||
/* native stack marker */
|
/* native stack marker */
|
||||||
pic->native_stack_start = &t;
|
pic->native_stack_start = &t;
|
||||||
|
|
||||||
/* symbol 0 is reserved for system */
|
|
||||||
xh_put(&pic->sym_names, pic->sym_cnt++, &"<system-reserved-symbol>");
|
|
||||||
|
|
||||||
#define register_core_symbol(pic,slot,name) do { \
|
#define register_core_symbol(pic,slot,name) do { \
|
||||||
pic->slot = pic_intern_cstr(pic, name); \
|
pic->slot = pic_intern_cstr(pic, name); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
@ -159,8 +156,6 @@ pic_close(pic_state *pic)
|
||||||
/* free symbol names */
|
/* free symbol names */
|
||||||
xh_begin(&it, &pic->sym_names);
|
xh_begin(&it, &pic->sym_names);
|
||||||
while (xh_next(&it)) {
|
while (xh_next(&it)) {
|
||||||
if (xh_key(it.e, pic_sym) == 0)
|
|
||||||
continue;
|
|
||||||
free(xh_val(it.e, char *));
|
free(xh_val(it.e, char *));
|
||||||
}
|
}
|
||||||
xh_destroy(&pic->sym_names);
|
xh_destroy(&pic->sym_names);
|
||||||
|
|
Loading…
Reference in New Issue