summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorGreg Brown <gmb60@cam.ac.uk>2020-11-30 17:33:49 +0000
committerGreg Brown <gmb60@cam.ac.uk>2020-11-30 17:33:49 +0000
commit7e9a41f578be2ec2de13fdd512df37884e514e10 (patch)
treec8d7a7e8f7d2177a87c2305edba7903bba10b916 /src/main.rs
parentaac8a2a06f557bda1893d891bf812c02b898d897 (diff)
Change type check infrastructure
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index 2e5532c..7c4babd 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,7 +1,4 @@
-use chomp::{
- ast::typed::{FlastContext, Type},
- nibble::File,
-};
+use chomp::{ast::TypeCheck, nibble::File};
use proc_macro2::Span;
use std::{
error::Error,
@@ -17,9 +14,9 @@ fn main() {
.map_err(|e| Box::new(e) as Box<dyn Error>)
.and_then(|_| syn::parse_str(&input).map_err(|e| Box::new(e) as Box<dyn Error>))
.and_then(|nibble: File| {
- nibble
- .convert_with_substitution()
- .well_typed(&mut FlastContext::new())
+ dbg!(nibble
+ .convert_with_substitution())
+ .fold(&mut TypeCheck::new())
.map_err(|e| Box::new(e) as Box<dyn Error>)
})
.map(|(typed, _)| typed.emit_code(Ident::new("Ast", Span::call_site())))