Move src/syn/word.rs to src/scope.rs; add BuiltinFn

* crate::scope instead of crate::syn::word, which makes more sense
  because scopes are not really used in syntax at all
* Reference-counted BuiltinFn values are available for creation now

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-01-12 18:00:11 -08:00
parent 1c669decc4
commit 907c8ce1af
8 changed files with 25 additions and 11 deletions

View File

@@ -13,8 +13,6 @@ pub enum RuntimeError {
#[error("cannot call non-quote value '{0}'")]
CannotCall(String),
//#[error("stack underflow")]
//StackUnderflow,
}
pub type Result<T, E = RuntimeError> = std::result::Result<T, E>;

View File

@@ -1,5 +1,5 @@
use crate::object::Value;
use crate::syn::words::Word;
use crate::scope::Word;
#[derive(Debug, Clone)]
pub enum Inst {

View File

@@ -1,6 +1,7 @@
use crate::compile::Compile;
use crate::object::*;
use crate::syn::{ast::SpExpr, words::*};
use crate::scope::*;
use crate::syn::ast::SpExpr;
use crate::vm::{error::*, inst::*};
use std::cell::RefCell;
use std::collections::BTreeMap;