diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-11-09 14:48:49 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-11-09 14:48:49 -0500 |
commit | 4b50a9fafe793abf3c2c16e203072a98a0702814 (patch) | |
tree | 52283545e15153a2adeba8145d8e018f97699cfe /libalee/state.hpp | |
parent | 3dc947a7575bd23703644996d8e853e5e618b2e3 (diff) |
move main execution to State; bring back verify()optimize
Diffstat (limited to 'libalee/state.hpp')
-rw-r--r-- | libalee/state.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libalee/state.hpp b/libalee/state.hpp index abf7a1e..529f118 100644 --- a/libalee/state.hpp +++ b/libalee/state.hpp @@ -25,8 +25,6 @@ #include <csetjmp> #include <cstddef> -#define verify(C, E) - constexpr unsigned DataStackSize = 64; constexpr unsigned ReturnStackSize = 64; @@ -52,6 +50,7 @@ public: * Encountering an error will cause this function to exit immediately. */ Error execute(Addr); + void execute1(Addr); /** * Clears the data and return stacks, sets ip to zero, and clears the @@ -135,10 +134,10 @@ public: return dict.read(context.ip); } -// inline void verify(bool condition, Error error) { -// if (!condition) -// std::longjmp(context.jmpbuf, static_cast<int>(error)); -// } + inline void verify(bool condition, Error error) { + if (!condition) + std::longjmp(context.jmpbuf, static_cast<int>(error)); + } private: InputFunc inputfunc; // User-provided function to collect "stdin" input. |