Add string support to the frontend

This commit is contained in:
Griffin Smith 2021-03-14 11:53:13 -04:00
parent 32a5c0ff0f
commit 39656a3801
10 changed files with 95 additions and 11 deletions

View file

@ -29,6 +29,7 @@ impl<'a> Interpreter<'a> {
Expr::Ident(id, _) => self.resolve(id),
Expr::Literal(Literal::Int(i), _) => Ok((*i).into()),
Expr::Literal(Literal::Bool(b), _) => Ok((*b).into()),
Expr::Literal(Literal::String(s), _) => Ok(s.clone().into()),
Expr::UnaryOp { op, rhs, .. } => {
let rhs = self.eval(rhs)?;
match op {