mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Add basic Expr formatter
This commit is contained in:
parent
75799abe22
commit
97209a9454
2 changed files with 63 additions and 0 deletions
|
@ -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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue