From 43bc7392ff10befe8f21e4eb3fef7ee541b190dc Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 30 Mar 2020 18:23:20 +0800 Subject: [PATCH] support boolean constants --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index 7c8ca6ae..c4768c54 100644 --- a/src/main.rs +++ b/src/main.rs @@ -197,6 +197,8 @@ impl<'ctx> CodeGen<'ctx> { self.set_source_location(expression.location); match &expression.node { + ast::ExpressionType::True => Ok(self.context.bool_type().const_int(1, false).into()), + ast::ExpressionType::False => Ok(self.context.bool_type().const_int(0, false).into()), ast::ExpressionType::Number { value: ast::Number::Integer { value } } => { let mut bits = value.bits(); if value.sign() == num_bigint::Sign::Minus {