diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-02-09 14:12:26 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-02-09 14:12:26 -0500 |
commit | 92680120c6e3902644171c37eb7b271cf2d82250 (patch) | |
tree | 0efa3beb7fe505b3005770420cbaa9fa5d1f1f78 /state.hpp | |
parent | 59ecb61463119e77637214e3c298c422c4537ea0 (diff) |
fix indentation
Diffstat (limited to 'state.hpp')
-rw-r--r-- | state.hpp | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -44,51 +44,51 @@ public: constexpr State(Dictionary& d): dict(d) {} Cell beyondip() const { - return dict.read(ip + 1); + return dict.read(ip + 1); } void pushr(Cell value) { - if (rsize() == ReturnStackSize) + if (rsize() == ReturnStackSize) throw; *++rsp = value; } Cell popr() { - if (rsize() == 0) + if (rsize() == 0) throw; - return *rsp--; + return *rsp--; } void push(Cell value) { - if (size() == DataStackSize) + if (size() == DataStackSize) throw; *++dsp = value; } Cell pop() { - if (size() == 0) + if (size() == 0) throw; - return *dsp--; + return *dsp--; } Cell& top() { - if (size() == 0) + if (size() == 0) throw; - return *dsp; + return *dsp; } Cell& pick(std::size_t i) { - if (i >= size()) - throw; - return *(dsp - i); + if (i >= size()) + throw; + return *(dsp - i); } std::size_t size() const noexcept { - return std::distance(dstack, static_cast<const Cell *>(dsp)) + 1; + return std::distance(dstack, static_cast<const Cell *>(dsp)) + 1; } std::size_t rsize() const noexcept { - return std::distance(rstack, static_cast<const Cell *>(rsp)) + 1; + return std::distance(rstack, static_cast<const Cell *>(rsp)) + 1; } }; |