about summary refs log tree commit diff
path: root/src/parse/ast
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2021-10-22 22:44:21 +0200
committerMel <einebeere@gmail.com>2021-10-22 22:52:24 +0200
commitc35a7ba06a47a8b26bd784df552ad4c881383898 (patch)
tree1ae23ace7246a0a97d6d53d6b0d0b88528ca5ad1 /src/parse/ast
parentce9007bd5aefc37cf7e48eefc0fab4049c8a6b7d (diff)
downloadrabbithole-c35a7ba06a47a8b26bd784df552ad4c881383898.tar.zst
rabbithole-c35a7ba06a47a8b26bd784df552ad4c881383898.zip
Boolean logic and If expressions.
Diffstat (limited to 'src/parse/ast')
-rw-r--r--src/parse/ast/nodes.rs3
1 files changed, 3 insertions, 0 deletions
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),
         }
     }