DEV: Translate fails into the Bang opcode.

This commit is contained in:
Jeremy Wall 2019-08-13 18:23:02 -05:00
parent 8c39c3826c
commit f9c3ebeb50

View File

@ -188,7 +188,10 @@ impl AST {
Expression::Grouped(expr, _) => { Expression::Grouped(expr, _) => {
Self::translate_expr(*expr, &mut ops); Self::translate_expr(*expr, &mut ops);
} }
Expression::Fail(_) => unimplemented!("Fail expressions are not implmented yet"), Expression::Fail(def) => {
Self::translate_expr(*def.message, &mut ops);
ops.push(Op::Bang);
}
Expression::Format(def) => { Expression::Format(def) => {
// TODO(jwall): It would actually be safer if this was happening // TODO(jwall): It would actually be safer if this was happening
// when we create the format def instead of here. // when we create the format def instead of here.