From bc3e952b487365fdf5e60e9fcfa0841c23972e30 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 11 Mar 2023 07:36:11 -0500 Subject: common error enum; eval to _ev --- libalee/state.hpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'libalee/state.hpp') diff --git a/libalee/state.hpp b/libalee/state.hpp index 648b868..325f405 100644 --- a/libalee/state.hpp +++ b/libalee/state.hpp @@ -24,6 +24,7 @@ #include #include +#include constexpr unsigned DataStackSize = 16; constexpr unsigned ReturnStackSize = 16; @@ -31,17 +32,6 @@ constexpr unsigned ReturnStackSize = 16; class State { public: - enum class Error : int { - none = 0, - push, - pop, - pushr, - popr, - top, - pick, - exit - }; - Addr ip = 0; Dictionary& dict; void (*input)(State&); @@ -54,7 +44,11 @@ public: bool compiling() const; void compiling(bool); + std::pair save(); + void load(const std::pair&); + Error execute(Addr); + void reset(); std::size_t size() const noexcept; std::size_t rsize() const noexcept; -- cgit v1.2.3