From 4b50a9fafe793abf3c2c16e203072a98a0702814 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 9 Nov 2023 14:48:49 -0500 Subject: move main execution to State; bring back verify() --- libalee/state.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'libalee/state.hpp') 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 #include -#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(error)); -// } + inline void verify(bool condition, Error error) { + if (!condition) + std::longjmp(context.jmpbuf, static_cast(error)); + } private: InputFunc inputfunc; // User-provided function to collect "stdin" input. -- cgit v1.2.3