Support for bools. Also fix fallible/infallible mixup for ctors.

This commit is contained in:
Chris Fallin
2021-09-09 16:26:35 -07:00
parent a412cce615
commit edc95c51a0
4 changed files with 35 additions and 6 deletions

View File

@@ -423,6 +423,12 @@ impl<'a> Parser<'a> {
self.rparen()?;
Ok(Expr::Term { sym, args })
}
} else if self.is_sym_str("#t") {
self.symbol()?;
Ok(Expr::ConstInt { val: 1 })
} else if self.is_sym_str("#f") {
self.symbol()?;
Ok(Expr::ConstInt { val: 0 })
} else if self.is_sym() {
let name = self.parse_ident()?;
Ok(Expr::Var { name })