|
|
@ -172,7 +172,8 @@ struct forth
|
|
|
|
|
|
|
|
|
|
|
|
if (auto ent = get(word); !ent) {
|
|
|
|
if (auto ent = get(word); !ent) {
|
|
|
|
cell n;
|
|
|
|
cell n;
|
|
|
|
const auto [p, e] = std::from_chars(word.cbegin(), word.cend(), n);
|
|
|
|
const auto [p, e] = std::from_chars(word.cbegin(), word.cend(),
|
|
|
|
|
|
|
|
n, base);
|
|
|
|
|
|
|
|
|
|
|
|
assert<error::word_not_found>(e == std::errc() && p == word.cend());
|
|
|
|
assert<error::word_not_found>(e == std::errc() && p == word.cend());
|
|
|
|
|
|
|
|
|
|
|
@ -356,6 +357,7 @@ struct forth
|
|
|
|
std::size_t sourcei = npos;
|
|
|
|
std::size_t sourcei = npos;
|
|
|
|
cell compiling = false;
|
|
|
|
cell compiling = false;
|
|
|
|
cell *end = nullptr;
|
|
|
|
cell *end = nullptr;
|
|
|
|
|
|
|
|
cell base = 10;
|
|
|
|
std::array<cell, data_size> dstack;
|
|
|
|
std::array<cell, data_size> dstack;
|
|
|
|
std::array<cell, return_size> rstack;
|
|
|
|
std::array<cell, return_size> rstack;
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -369,6 +371,7 @@ static_assert(offsetof(forth, source) == 5 * sizeof(forth::cell));
|
|
|
|
static_assert(offsetof(forth, sourcei) == 6 * sizeof(forth::cell));
|
|
|
|
static_assert(offsetof(forth, sourcei) == 6 * sizeof(forth::cell));
|
|
|
|
static_assert(offsetof(forth, compiling) == 7 * sizeof(forth::cell));
|
|
|
|
static_assert(offsetof(forth, compiling) == 7 * sizeof(forth::cell));
|
|
|
|
static_assert(offsetof(forth, end) == 8 * sizeof(forth::cell));
|
|
|
|
static_assert(offsetof(forth, end) == 8 * sizeof(forth::cell));
|
|
|
|
|
|
|
|
static_assert(offsetof(forth, base) == 9 * sizeof(forth::cell));
|
|
|
|
|
|
|
|
|
|
|
|
#endif // SFORTH_HPP
|
|
|
|
#endif // SFORTH_HPP
|
|
|
|
|
|
|
|
|
|
|
|