From 894bbca38e3b48fa4e2396378d8177530b1a2c49 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 27 Mar 2020 16:54:41 +0800 Subject: [PATCH] add some types --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 37d26117..ed3f4642 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,9 +45,12 @@ impl<'ctx> CodeGen<'ctx> { fn get_basic_type(&self, name: &str) -> CompileResult> { match name { + "bool" => Ok(self.context.bool_type().into()), "int32" => Ok(self.context.i32_type().into()), "int64" => Ok(self.context.i64_type().into()), - _ => Err(CompileError) + "float32" => Ok(self.context.f32_type().into()), + "float64" => Ok(self.context.f64_type().into()), + _ => Err(self.compile_error(CompileErrorKind::UnknownTypeAnnotation)) } }