|
|
@ -302,13 +302,6 @@ static enum fh_error w_colon(struct fh_thread_s *fh, const struct fh_word_s *w) |
|
|
|
return FH_OK; |
|
|
|
return FH_OK; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static enum fh_error w_redirect(struct fh_thread_s *fh, const struct fh_word_s *w) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
const struct fh_word_s *w2 = &fh->dict[w->param]; |
|
|
|
|
|
|
|
LOG("REDIRECT to %s", w2->name); |
|
|
|
|
|
|
|
return w2->handler(fh, w2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static enum fh_error w_semicolon(struct fh_thread_s *fh, const struct fh_word_s *w0) |
|
|
|
static enum fh_error w_semicolon(struct fh_thread_s *fh, const struct fh_word_s *w0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
(void) w0; |
|
|
|
(void) w0; |
|
|
@ -331,7 +324,7 @@ static enum fh_error w_semicolon(struct fh_thread_s *fh, const struct fh_word_s |
|
|
|
if (0 == strncasecmp(new_word->name, old_word->name, MAX_NAME_LEN)) { |
|
|
|
if (0 == strncasecmp(new_word->name, old_word->name, MAX_NAME_LEN)) { |
|
|
|
// We can't move the new definition because of RECURSE already using its address.
|
|
|
|
// We can't move the new definition because of RECURSE already using its address.
|
|
|
|
// Instead, redirect and wipe the old name.
|
|
|
|
// Instead, redirect and wipe the old name.
|
|
|
|
old_word->handler = w_redirect; |
|
|
|
// Note that this leaks compile memory!
|
|
|
|
old_word->start = new_word->start; |
|
|
|
old_word->start = new_word->start; |
|
|
|
old_word->name[0] = 0; |
|
|
|
old_word->name[0] = 0; |
|
|
|
break; |
|
|
|
break; |
|
|
|