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::{backend::Backend, ir::TypeInferenceResult};
use crate::{backend::Backend, type_infer::TypeInferenceResult};
use codespan_reporting::{
diagnostic::Diagnostic,
files::SimpleFiles,

View File

@@ -12,10 +12,8 @@
//! 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
//! come to for analysis and optimization work.
mod ast;
pub mod ast;
mod eval;
mod strings;
mod type_infer;
pub use ast::*;
pub use type_infer::{TypeInferenceError, TypeInferenceResult, TypeInferenceWarning};

View File

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

View File

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

View File

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