From 32a5c0ff0fc58aa6721c1e0ad41950bde2d66744 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 13 Mar 2021 21:57:27 -0500 Subject: Add the start of a hindley-milner typechecker The beginning of a parse-don't-validate-based hindley-milner typechecker, which returns on success an IR where every AST node trivially knows its own type, and using those types to determine LLVM types in codegen. --- src/ast/mod.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ast/mod.rs') diff --git a/src/ast/mod.rs b/src/ast/mod.rs index dc22ac3cdb56..cef366d16e04 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -1,3 +1,5 @@ +pub(crate) mod hir; + use std::borrow::Cow; use std::convert::TryFrom; use std::fmt::{self, Display, Formatter}; @@ -107,6 +109,7 @@ pub enum UnaryOperator { #[derive(Debug, PartialEq, Eq, Clone)] pub enum Literal { Int(u64), + Bool(bool), } #[derive(Debug, PartialEq, Eq, Clone)] -- cgit 1.4.1