From aba7e62e49ac9dead0a2868f739091d2d15ff0d1 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 31 Aug 2019 21:59:39 +0200 Subject: Implement parsing of `toMap` keyword --- dhall_syntax/src/printer.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'dhall_syntax/src/printer.rs') 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 Display for ExprF { 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 RawExpr { | NEListLit(_) | SomeLit(_) | Merge(_, _, _) + | ToMap(_, _) | Annot(_, _) if phase > Base => { @@ -172,6 +179,10 @@ impl RawExpr { 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, -- cgit v1.2.3