Move type module out of abstract tree module

This commit is contained in:
Jeff 2024-08-02 16:33:40 -04:00
parent 3fae807d9f
commit 2f06b18c3c
8 changed files with 12 additions and 11 deletions

View File

@ -14,7 +14,6 @@ pub mod map_index;
pub mod math;
pub mod statement;
pub mod structure_definition;
pub mod r#type;
pub mod type_alias;
pub mod type_constructor;
pub mod r#use;
@ -45,7 +44,6 @@ pub use self::{
math::Math,
r#as::As,
r#loop::Loop,
r#type::Type,
r#use::Use,
r#while::While,
statement::Statement,
@ -58,6 +56,7 @@ pub use self::{
use crate::{
context::Context,
error::{DustError, RuntimeError, ValidationError},
r#type::Type,
Value,
};

View File

@ -9,12 +9,12 @@ use log::trace;
use rand::random;
use crate::{
abstract_tree::{SourcePosition, Type},
abstract_tree::SourcePosition,
error::{PoisonError, ValidationError},
identifier::Identifier,
standard_library::core_context,
value::ValueInner,
Value,
Type, Value,
};
type VariableInfo = (VariableData, UsageData, SourcePosition);

View File

@ -3,9 +3,10 @@ use std::{io, sync::PoisonError as StdPoisonError};
use chumsky::{prelude::Rich, span::Span};
use crate::{
abstract_tree::{r#type::Type, Expression, SourcePosition, TypeConstructor},
abstract_tree::{Expression, SourcePosition, TypeConstructor},
identifier::Identifier,
lexer::Token,
Type,
};
#[derive(Debug, PartialEq)]

View File

@ -15,11 +15,12 @@ pub mod interpreter;
pub mod lexer;
pub mod parser;
pub mod standard_library;
pub mod r#type;
pub mod value;
pub use abstract_tree::Type;
pub use context::Context;
pub use interpreter::{interpret, Interpreter, InterpreterError};
pub use lexer::{lex, lexer};
pub use parser::{parse, parser};
pub use r#type::Type;
pub use value::Value;

View File

@ -15,10 +15,11 @@ use serde::{
};
use crate::{
abstract_tree::{AbstractNode, Block, BuiltInFunction, Evaluation, SourcePosition, Type},
abstract_tree::{AbstractNode, Block, BuiltInFunction, Evaluation, SourcePosition},
context::Context,
error::{RuntimeError, ValidationError},
identifier::Identifier,
Type,
};
#[derive(Clone, Debug, PartialEq)]

View File

@ -1,10 +1,9 @@
use std::collections::BTreeMap;
use dust_lang::{
abstract_tree::Type,
error::{DustError, TypeConflict, ValidationError},
identifier::Identifier,
*,
Type, *,
};
#[test]

View File

@ -1,7 +1,7 @@
use dust_lang::{
abstract_tree::{Block, Expression, Statement, Type, WithPos},
abstract_tree::{Block, Expression, Statement, WithPos},
identifier::Identifier,
*,
Type, *,
};
#[test]