Add basic Expr formatter

This commit is contained in:
Richard Feldman 2019-09-15 21:37:20 -04:00
parent 75799abe22
commit 97209a9454
2 changed files with 63 additions and 0 deletions

View file

@ -1,6 +1,7 @@
use operator::Operator;
use parse::problems::Problem;
use region::Loc;
use std::fmt::{self, Display, Formatter};
pub type Ident = str;
pub type VariantName = str;
@ -157,3 +158,14 @@ pub enum Attempting {
Module,
Identifier,
}
impl<'a> Display for Expr<'a> {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
use self::Expr::*;
match self {
EmptyStr => write!(f, "\"\""),
_ => panic!("TODO"),
}
}
}