lift the inference engine up a level

This commit is contained in:
2023-07-21 21:40:41 -07:00
parent 9fb6bf3b86
commit a8d32a917f
9 changed files with 5 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
use crate::syntax::Program as Syntax; use crate::syntax::Program as Syntax;
use crate::{backend::Backend, ir::TypeInferenceResult}; use crate::{backend::Backend, type_infer::TypeInferenceResult};
use codespan_reporting::{ use codespan_reporting::{
diagnostic::Diagnostic, diagnostic::Diagnostic,
files::SimpleFiles, files::SimpleFiles,

View File

@@ -12,10 +12,8 @@
//! validating syntax, and then figuring out how to turn it into Cranelift //! validating syntax, and then figuring out how to turn it into Cranelift
//! and object code. After that point, however, this will be the module to //! and object code. After that point, however, this will be the module to
//! come to for analysis and optimization work. //! come to for analysis and optimization work.
mod ast; pub mod ast;
mod eval; mod eval;
mod strings; mod strings;
mod type_infer;
pub use ast::*; pub use ast::*;
pub use type_infer::{TypeInferenceError, TypeInferenceResult, TypeInferenceWarning};

View File

@@ -67,6 +67,7 @@ pub mod eval;
mod examples; mod examples;
pub mod ir; pub mod ir;
pub mod syntax; pub mod syntax;
pub mod type_infer;
/// Implementation module for the high-level compiler. /// Implementation module for the high-level compiler.
mod compiler; mod compiler;

View File

@@ -1,5 +1,5 @@
use crate::backend::{Backend, BackendError}; use crate::backend::{Backend, BackendError};
use crate::ir::TypeInferenceResult; use crate::type_infer::TypeInferenceResult;
use crate::syntax::{ConstantType, Location, ParserError, Statement}; use crate::syntax::{ConstantType, Location, ParserError, Statement};
use codespan_reporting::diagnostic::Diagnostic; use codespan_reporting::diagnostic::Diagnostic;
use codespan_reporting::files::SimpleFiles; use codespan_reporting::files::SimpleFiles;

View File

@@ -1,7 +1,7 @@
use super::ast as ir; use super::ast as ir;
use super::ast::Type; use super::ast::Type;
use crate::eval::PrimitiveType; use crate::eval::PrimitiveType;
use crate::ir::type_infer::solve::Constraint; use crate::type_infer::solve::Constraint;
use crate::syntax::{self, ConstantType}; use crate::syntax::{self, ConstantType};
use internment::ArcIntern; use internment::ArcIntern;
use std::collections::HashMap; use std::collections::HashMap;