|
|
|
@ -10,12 +10,14 @@ static enum fh_error w_colon(struct fh_thread_s *fh, const struct fh_word_s *w) |
|
|
|
|
size_t namelen = 0; |
|
|
|
|
fh_input_consume_spaces(fh); |
|
|
|
|
TRY(fh_input_read_word(fh, &wordname, &namelen)); |
|
|
|
|
LOG("Name: %.*s", (int) namelen, wordname); |
|
|
|
|
|
|
|
|
|
fh_setstate(fh, FH_STATE_COMPILE, 0); |
|
|
|
|
|
|
|
|
|
uint32_t ptr; |
|
|
|
|
fh_align(fh); |
|
|
|
|
TRY(fh_heap_reserve(fh, DICTWORD_SIZE, &ptr)); |
|
|
|
|
|
|
|
|
|
LOG("New word \"%.*s\", head at 0x%08x, exec at 0x%08x", (int) namelen, wordname, ptr, fh->here); |
|
|
|
|
|
|
|
|
|
struct fh_word_s *new_word = fh_word_at(fh, ptr); |
|
|
|
|
if (!new_word) { return FH_ERR_INTERNAL; } |
|
|
|
@ -89,6 +91,7 @@ static enum fh_error w_colon_noname(struct fh_thread_s *fh, const struct fh_word |
|
|
|
|
fh_setstate(fh, FH_STATE_COMPILE, 0); |
|
|
|
|
|
|
|
|
|
uint32_t ptr; |
|
|
|
|
fh_align(fh); |
|
|
|
|
TRY(fh_heap_reserve(fh, DICTWORD_SIZE, &ptr)); |
|
|
|
|
|
|
|
|
|
struct fh_word_s *new_word = fh_word_at(fh, ptr); |
|
|
|
@ -218,6 +221,7 @@ static enum fh_error wp_variable(struct fh_thread_s *fh, const struct fh_word_s |
|
|
|
|
TRY(ds_pop(fh, &value)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fh_align(fh); |
|
|
|
|
TRY(fh_heap_reserve(fh, DICTWORD_SIZE, &ptr)); |
|
|
|
|
|
|
|
|
|
struct fh_word_s *new_word = fh_word_at(fh, ptr); |
|
|
|
@ -536,6 +540,7 @@ static enum fh_error w_defer(struct fh_thread_s *fh, const struct fh_word_s *w) |
|
|
|
|
|
|
|
|
|
uint32_t ptr; |
|
|
|
|
|
|
|
|
|
fh_align(fh); |
|
|
|
|
TRY(fh_heap_reserve(fh, DICTWORD_SIZE, &ptr)); |
|
|
|
|
|
|
|
|
|
struct fh_word_s *new_word = fh_word_at(fh, ptr); |
|
|
|
|