Boolean literals
diff --git a/src/lit.rs b/src/lit.rs
index c7a647f..b3d2954 100644
--- a/src/lit.rs
+++ b/src/lit.rs
@@ -67,7 +67,10 @@
|
int => { |(value, ty)| Lit::Int(value, ty) }
// TODO: Float
- // TODO: Bool
+ |
+ keyword!("true") => { |_| Lit::Bool(true) }
+ |
+ keyword!("false") => { |_| Lit::Bool(false) }
));
named!(string -> Lit, alt!(
@@ -180,6 +183,8 @@
tokens.append(&escaped);
}
Lit::Int(value, ty) => tokens.append(&format!("{}{}", value, ty)),
+ Lit::Bool(true) => tokens.append("true"),
+ Lit::Bool(false) => tokens.append("false"),
_ => unimplemented!(),
}
}