diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-03-11 07:36:11 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-03-11 07:36:11 -0500 |
commit | bc3e952b487365fdf5e60e9fcfa0841c23972e30 (patch) | |
tree | cc53facc2a62db4dc93a25c772f521786305ead8 /libalee/corewords.cpp | |
parent | f8270776e79f4d2edb7c2a19c1ecd3bf3b2bf153 (diff) |
common error enum; eval to _ev
Diffstat (limited to 'libalee/corewords.cpp')
-rw-r--r-- | libalee/corewords.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
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 <cstring> #include <utility> @@ -171,10 +172,8 @@ execute: goto execute; case 25: // exit state.ip = state.popr(); - if (state.ip == 0) { - std::longjmp(state.jmpbuf, - static_cast<int>(State::Error::exit)); - } + if (state.ip == 0) + std::longjmp(state.jmpbuf, static_cast<int>(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; |