|
|
|
@ -27,6 +27,7 @@ static const char *substatenames[FH_SUBSTATE_MAX] = { |
|
|
|
|
[FH_SUBSTATE_DOTQUOTE] = "DOTQUOTE", |
|
|
|
|
[FH_SUBSTATE_PARENCOMMENT] = "PARENCOMMENT", |
|
|
|
|
[FH_SUBSTATE_LINECOMMENT] = "LINECOMMENT", |
|
|
|
|
[FH_SUBSTATE_EXIT] = "EXIT", |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** Add a word to the dictionary. */ |
|
|
|
@ -90,7 +91,7 @@ enum fh_error w_user_word(struct fh_thread_s *fh, const struct fh_word_s *w0) |
|
|
|
|
// make sure it's aligned
|
|
|
|
|
fh->execptr = WORDALIGNED(fh->execptr); |
|
|
|
|
const struct fh_instruction_s *instr = (const struct fh_instruction_s *) &fh->compile[fh->execptr]; |
|
|
|
|
fh->execptr += sizeof(struct fh_instruction_s); |
|
|
|
|
fh->execptr += INSTR_SIZE; |
|
|
|
|
|
|
|
|
|
uint32_t strl; |
|
|
|
|
uint32_t addr = 0; |
|
|
|
@ -134,6 +135,14 @@ enum fh_error w_user_word(struct fh_thread_s *fh, const struct fh_word_s *w0) |
|
|
|
|
if (w2->builtin) { |
|
|
|
|
LOG("Exec: builtin-word %s", w2->name); |
|
|
|
|
w2->handler(fh, w2); |
|
|
|
|
if (fh->substate == FH_SUBSTATE_EXIT) { |
|
|
|
|
fh_setsubstate(fh, 0); |
|
|
|
|
LOG("Exec: early return"); |
|
|
|
|
TRY(rs_pop(fh, &fh->execptr)); |
|
|
|
|
if (fh->execptr == MAGICADDR_INTERACTIVE) { |
|
|
|
|
goto end; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
goto instr; |
|
|
|
|
} else { |
|
|
|
|
LOG("Exec: user-word %s (CALL)", w2->name); |
|
|
|
|