this should be handled in the compile end nat
This commit is contained in:
parent
8a0a2cf68f
commit
bc9bc44e5d
1 changed files with 11 additions and 9 deletions
20
pila.c
20
pila.c
|
@ -393,8 +393,14 @@ compile_end_nat(Pila *st)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Assert(st->cur_compw != nil);
|
Assert(st->cur_compw != nil);
|
||||||
|
if (!Str_empty(st->cur_compw->name))
|
||||||
|
add_word(st, st->cur_compw);
|
||||||
|
else /* for an anonymous word */
|
||||||
|
push_val(st, BOX_INTN((u64)st->cur_compw));
|
||||||
|
|
||||||
st->compiling = false;
|
st->compiling = false;
|
||||||
add_word(st, st->cur_compw);
|
st->cur_compw = nil;
|
||||||
|
st->cur_compw_cap = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Str
|
Str
|
||||||
|
@ -499,14 +505,10 @@ branch_nat(Pila *st)
|
||||||
void
|
void
|
||||||
add_word(Pila *st, Word *w)
|
add_word(Pila *st, Word *w)
|
||||||
{
|
{
|
||||||
if (!Str_empty(w->name)) {
|
DictionaryEntry *de = malloc(sizeof(*de));
|
||||||
DictionaryEntry *de = malloc(sizeof(*de));
|
de->word = w;
|
||||||
de->word = w;
|
de->next = st->dict != nil ? st->dict : nil;
|
||||||
de->next = st->dict != nil ? st->dict : nil;
|
st->dict = de;
|
||||||
st->dict = de;
|
|
||||||
} else {
|
|
||||||
push_val(st, BOX_INTN((u64)w));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Word *
|
Word *
|
||||||
|
|
Loading…
Add table
Reference in a new issue