cl-interpret: Stop kidding myself, I'll be replacing the interpreter before I get rid of this.
This commit is contained in:
parent
e0f54aea97
commit
406bfb8882
@ -3,7 +3,7 @@
|
|||||||
use super::{
|
use super::{
|
||||||
env::Environment,
|
env::Environment,
|
||||||
error::{Error, IResult},
|
error::{Error, IResult},
|
||||||
temp_type_impl::ConValue,
|
convalue::ConValue,
|
||||||
BuiltIn, Callable,
|
BuiltIn, Callable,
|
||||||
};
|
};
|
||||||
use cl_ast::Sym;
|
use cl_ast::Sym;
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
#![feature(decl_macro)]
|
#![feature(decl_macro)]
|
||||||
|
|
||||||
use cl_ast::Sym;
|
use cl_ast::Sym;
|
||||||
|
use convalue::ConValue;
|
||||||
use env::Environment;
|
use env::Environment;
|
||||||
use error::{Error, IResult};
|
use error::{Error, IResult};
|
||||||
use interpret::Interpret;
|
use interpret::Interpret;
|
||||||
use temp_type_impl::ConValue;
|
|
||||||
|
|
||||||
/// Callable types can be called from within a Conlang program
|
/// Callable types can be called from within a Conlang program
|
||||||
pub trait Callable: std::fmt::Debug {
|
pub trait Callable: std::fmt::Debug {
|
||||||
@ -22,8 +22,8 @@ pub trait BuiltIn: std::fmt::Debug + Callable {
|
|||||||
fn description(&self) -> &str;
|
fn description(&self) -> &str;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod temp_type_impl {
|
pub mod convalue {
|
||||||
//! Temporary implementations of Conlang values
|
//! Values in the dynamically typed AST interpreter.
|
||||||
//!
|
//!
|
||||||
//! The most permanent fix is a temporary one.
|
//! The most permanent fix is a temporary one.
|
||||||
use cl_ast::Sym;
|
use cl_ast::Sym;
|
||||||
@ -37,10 +37,7 @@ pub mod temp_type_impl {
|
|||||||
|
|
||||||
type Integer = isize;
|
type Integer = isize;
|
||||||
|
|
||||||
/// A Conlang value
|
/// A Conlang value stores data in the interpreter
|
||||||
///
|
|
||||||
/// This is a hack to work around the fact that Conlang doesn't
|
|
||||||
/// have a functioning type system yet :(
|
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub enum ConValue {
|
pub enum ConValue {
|
||||||
/// The empty/unit `()` type
|
/// The empty/unit `()` type
|
||||||
@ -365,9 +362,9 @@ pub mod env {
|
|||||||
//! Lexical and non-lexical scoping for variables
|
//! Lexical and non-lexical scoping for variables
|
||||||
use super::{
|
use super::{
|
||||||
builtin::{BINARY, MISC, RANGE, UNARY},
|
builtin::{BINARY, MISC, RANGE, UNARY},
|
||||||
|
convalue::ConValue,
|
||||||
error::{Error, IResult},
|
error::{Error, IResult},
|
||||||
function::Function,
|
function::Function,
|
||||||
temp_type_impl::ConValue,
|
|
||||||
BuiltIn, Callable, Interpret,
|
BuiltIn, Callable, Interpret,
|
||||||
};
|
};
|
||||||
use cl_ast::{Function as FnDecl, Sym};
|
use cl_ast::{Function as FnDecl, Sym};
|
||||||
@ -534,7 +531,7 @@ pub mod error {
|
|||||||
|
|
||||||
use cl_ast::Sym;
|
use cl_ast::Sym;
|
||||||
|
|
||||||
use super::temp_type_impl::ConValue;
|
use super::convalue::ConValue;
|
||||||
|
|
||||||
pub type IResult<T> = Result<T, Error>;
|
pub type IResult<T> = Result<T, Error>;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#![allow(unused_imports)]
|
#![allow(unused_imports)]
|
||||||
use crate::{env::Environment, temp_type_impl::ConValue, Interpret};
|
use crate::{env::Environment, convalue::ConValue, Interpret};
|
||||||
use cl_ast::*;
|
use cl_ast::*;
|
||||||
use cl_lexer::Lexer;
|
use cl_lexer::Lexer;
|
||||||
use cl_parser::Parser;
|
use cl_parser::Parser;
|
||||||
|
@ -5,7 +5,7 @@ use crate::{
|
|||||||
menu,
|
menu,
|
||||||
tools::print_token,
|
tools::print_token,
|
||||||
};
|
};
|
||||||
use cl_interpret::{env::Environment, interpret::Interpret, temp_type_impl::ConValue};
|
use cl_interpret::{convalue::ConValue, env::Environment, interpret::Interpret};
|
||||||
use cl_lexer::Lexer;
|
use cl_lexer::Lexer;
|
||||||
use cl_parser::Parser;
|
use cl_parser::Parser;
|
||||||
use std::{error::Error, path::Path};
|
use std::{error::Error, path::Path};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use cl_interpret::{
|
use cl_interpret::{
|
||||||
env::Environment, error::IResult, interpret::Interpret, temp_type_impl::ConValue,
|
env::Environment, error::IResult, interpret::Interpret, convalue::ConValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
Loading…
Reference in New Issue
Block a user