diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-02-09 21:54:58 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-02-09 21:54:58 -0500 |
commit | 18bcd5dd0e283100d25ca44e60f1705f3c028456 (patch) | |
tree | c254e759d7ff8251ad9cf7b8aaa03f86b84ad7d8 /parser.cpp | |
parent | 27742595b575c59b1f482e5a72195fdfbf16c5d6 (diff) |
depth and more core.fth words
Diffstat (limited to 'parser.cpp')
-rw-r--r-- | parser.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -39,12 +39,12 @@ ParseStatus Parser::parse(State& state, std::string_view& str) break; case Pass::Colon: state.pass = Pass::None; - state.compiling = true; + state.compiling(true); state.dict.addDefinition(sub); break; case Pass::Constant: state.pass = Pass::None; - state.compiling = true; + state.compiling(true); state.dict.addDefinition(sub); state.dict.add(CoreWords::HiddenWordLiteral); state.dict.add(state.pop()); @@ -56,18 +56,18 @@ ParseStatus Parser::parse(State& state, std::string_view& str) } } else { if (auto i = CoreWords::findi(sub); i >= 0) { - if (state.compiling) + if (state.compiling()) state.dict.add(i & ~CoreWords::CoreImmediate); - if (!state.compiling || (i & CoreWords::CoreImmediate)) + if (!state.compiling() || (i & CoreWords::CoreImmediate)) CoreWords::run(i & ~CoreWords::CoreImmediate, state); } else if (auto j = state.dict.find(sub); j > 0) { auto e = state.dict.getexec(j); - if (state.compiling) { + if (state.compiling()) { if (state.dict.read(j) & CoreWords::Immediate) { - state.compiling = false; + state.compiling(false); Executor::fullexec(state, e); - state.compiling = true; + state.compiling(true); } else { state.dict.add(CoreWords::HiddenWordJump); state.dict.add(e); @@ -81,7 +81,7 @@ ParseStatus Parser::parse(State& state, std::string_view& str) const auto l = static_cast<Cell>(std::strtol(sub.data(), &p, base)); if (p != sub.data()) { - if (state.compiling) { + if (state.compiling()) { state.dict.add(CoreWords::HiddenWordLiteral); state.dict.add(l); } else { |