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/corewords.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'libalee/corewords.cpp') diff --git a/libalee/corewords.cpp b/libalee/corewords.cpp index ced3973..b8a415e 100644 --- a/libalee/corewords.cpp +++ b/libalee/corewords.cpp @@ -17,6 +17,7 @@ */ #include "corewords.hpp" +#include "parser.hpp" #include #include @@ -171,10 +172,8 @@ execute: goto execute; case 25: // exit state.ip = state.popr(); - if (state.ip == 0) { - std::longjmp(state.jmpbuf, - static_cast(State::Error::exit)); - } + if (state.ip == 0) + std::longjmp(state.jmpbuf, static_cast(Error::exit)); break; case 26: // semic { @@ -206,6 +205,14 @@ execute: case 31: // _in state.input(state); break; + case 32: // _ex + { + const auto st = state.save(); + state.ip = 0; + Parser::parseSource(state); + state.load(st); + } + break; default: state.push(index - WordCount); break; -- cgit v1.2.3