🤔 Add a type inference engine, along with typed literals. #4
@@ -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,
|
||||||
|
|||||||
@@ -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};
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
Reference in New Issue
Block a user