diff options
author | Nadrieril Feneanar | 2019-08-31 22:09:07 +0200 |
---|---|---|
committer | GitHub | 2019-08-31 22:09:07 +0200 |
commit | 774d1affe13b50945517ccc43f9d4e771841e4a2 (patch) | |
tree | 6c257318d9706ed1ea1336eef2059ac826719194 /dhall_syntax/src/core | |
parent | a2c2cd76d256a4e6ca66b9b1bd756fb17e600ef5 (diff) | |
parent | aba7e62e49ac9dead0a2868f739091d2d15ff0d1 (diff) |
Merge pull request #109 from Nadrieril/tomap-parsing
Implement parsing of `toMap` keyword
Diffstat (limited to '')
-rw-r--r-- | dhall_syntax/src/core/expr.rs | 2 | ||||
-rw-r--r-- | dhall_syntax/src/core/visitor.rs | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/dhall_syntax/src/core/expr.rs b/dhall_syntax/src/core/expr.rs index 2d73a64..51b6c47 100644 --- a/dhall_syntax/src/core/expr.rs +++ b/dhall_syntax/src/core/expr.rs @@ -243,6 +243,8 @@ pub enum ExprF<SubExpr, Embed> { UnionType(DupTreeMap<Label, Option<SubExpr>>), /// `merge x y : t` Merge(SubExpr, SubExpr, Option<SubExpr>), + /// `toMap x : t` + ToMap(SubExpr, Option<SubExpr>), /// `e.x` Field(SubExpr, Label), /// `e.{ x, y, z }` diff --git a/dhall_syntax/src/core/visitor.rs b/dhall_syntax/src/core/visitor.rs index 49fff60..435771e 100644 --- a/dhall_syntax/src/core/visitor.rs +++ b/dhall_syntax/src/core/visitor.rs @@ -150,6 +150,9 @@ where v.visit_subexpr(y)?, opt(t, |e| v.visit_subexpr(e))?, ), + ToMap(x, t) => { + ToMap(v.visit_subexpr(x)?, opt(t, |e| v.visit_subexpr(e))?) + } Field(e, l) => Field(v.visit_subexpr(e)?, l.clone()), Projection(e, ls) => Projection(v.visit_subexpr(e)?, ls.clone()), Assert(e) => Assert(v.visit_subexpr(e)?), |