From a79eaf8e16b50c7798d9a285da251df6bce43b32 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan <clyne@bitgloo.com> Date: Wed, 12 Jun 2024 06:55:37 -0400 Subject: refactor, encapsulate --- source/core.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/core.hpp') diff --git a/source/core.hpp b/source/core.hpp index 8b220e4..935fc0c 100644 --- a/source/core.hpp +++ b/source/core.hpp @@ -1,5 +1,5 @@ // sprit-forth: A portable subroutine-threaded Forth. -// Copyright (C) 2023 Clyne Sullivan <clyne@bitgloo.com> +// Copyright (C) 2024 Clyne Sullivan <clyne@bitgloo.com> // // This library is free software; you can redistribute it and/or modify it // under the terms of the GNU Library General Public License as published by @@ -18,7 +18,8 @@ #ifndef CORE_HPP #define CORE_HPP -#include "types.hpp" +#include "executor.hpp" +#include "state.hpp" /** * To be implemented by the user: Adds available input to the source buffer. @@ -30,9 +31,7 @@ extern void getinput(); * "Function exit" word, analagous to a function's return statement. */ constexpr auto fexit = WordWrap<[] { - extern FuncList IP; - extern Cell rpop(); - IP = reinterpret_cast<FuncList>(rpop()); + Exec.ip = reinterpret_cast<FuncList>(Forth.rpop()); }>; void jump(FuncList ip); /** Jumps to the given instruction pointer. */ -- cgit v1.2.3