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

View File

@ -9,12 +9,12 @@ use log::trace;
use rand::random; use rand::random;
use crate::{ use crate::{
abstract_tree::{SourcePosition, Type}, abstract_tree::SourcePosition,
error::{PoisonError, ValidationError}, error::{PoisonError, ValidationError},
identifier::Identifier, identifier::Identifier,
standard_library::core_context, standard_library::core_context,
value::ValueInner, value::ValueInner,
Value, Type, Value,
}; };
type VariableInfo = (VariableData, UsageData, SourcePosition); 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 chumsky::{prelude::Rich, span::Span};
use crate::{ use crate::{
abstract_tree::{r#type::Type, Expression, SourcePosition, TypeConstructor}, abstract_tree::{Expression, SourcePosition, TypeConstructor},
identifier::Identifier, identifier::Identifier,
lexer::Token, lexer::Token,
Type,
}; };
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]

View File

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

View File

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

View File

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

View File

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