From c35a7ba06a47a8b26bd784df552ad4c881383898 Mon Sep 17 00:00:00 2001 From: Mel Date: Fri, 22 Oct 2021 22:44:21 +0200 Subject: Boolean logic and If expressions. --- src/parse/ast/nodes.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/parse/ast/nodes.rs') diff --git a/src/parse/ast/nodes.rs b/src/parse/ast/nodes.rs index 2347d5b..36b15c8 100644 --- a/src/parse/ast/nodes.rs +++ b/src/parse/ast/nodes.rs @@ -63,6 +63,7 @@ pub enum Literal { Int(u32), Float(f32), Str(String), + Bool(bool), } impl Literal { @@ -71,6 +72,8 @@ impl Literal { Int(int) => Self::Int(int), Float(float) => Self::Float(float), Str(string) => Self::Str(string), + KeywordTrue => Self::Bool(true), + KeywordFalse => Self::Bool(false), _ => panic!("Can't create literal from '{:?}'.", token.variant), } } -- cgit 1.4.1