diff options
author | Nadrieril | 2019-08-31 21:59:39 +0200 |
---|---|---|
committer | Nadrieril | 2019-08-31 21:59:39 +0200 |
commit | aba7e62e49ac9dead0a2868f739091d2d15ff0d1 (patch) | |
tree | 6c257318d9706ed1ea1336eef2059ac826719194 /dhall_syntax/src/printer.rs | |
parent | a2c2cd76d256a4e6ca66b9b1bd756fb17e600ef5 (diff) |
Implement parsing of `toMap` keyword
Diffstat (limited to 'dhall_syntax/src/printer.rs')
-rw-r--r-- | dhall_syntax/src/printer.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/dhall_syntax/src/printer.rs b/dhall_syntax/src/printer.rs index 276590e..8571d11 100644 --- a/dhall_syntax/src/printer.rs +++ b/dhall_syntax/src/printer.rs @@ -41,6 +41,12 @@ impl<SE: Display + Clone, E: Display> Display for ExprF<SE, E> { write!(f, " : {}", c)?; } } + ToMap(a, b) => { + write!(f, "toMap {}", a)?; + if let Some(b) = b { + write!(f, " : {}", b)?; + } + } Annot(a, b) => { write!(f, "{} : {}", a, b)?; } @@ -144,6 +150,7 @@ impl<A: Display + Clone> RawExpr<A> { | NEListLit(_) | SomeLit(_) | Merge(_, _, _) + | ToMap(_, _) | Annot(_, _) if phase > Base => { @@ -172,6 +179,10 @@ impl<A: Display + Clone> RawExpr<A> { b.phase(PrintPhase::Import), c.map(|x| x.phase(PrintPhase::App)), ), + ToMap(a, b) => ToMap( + a.phase(PrintPhase::Import), + b.map(|x| x.phase(PrintPhase::App)), + ), Annot(a, b) => Annot(a.phase(Operator), b), ExprF::BinOp(op, a, b) => ExprF::BinOp( op, |