diff options
author | Nadrieril | 2020-02-20 18:52:34 +0000 |
---|---|---|
committer | Nadrieril | 2020-02-20 18:54:11 +0000 |
commit | 86508a3ad59a0bfc1e24448d0a0126b1a1c645e1 (patch) | |
tree | 05db6aab6499ba2a3d91e0253571ee3cf5fefc8f /dhall/src/syntax/ast | |
parent | 26ed5a1d4d43573ac8ad2f8de9e4dd411650aa9a (diff) |
Add support for duplicate record fields
Diffstat (limited to 'dhall/src/syntax/ast')
-rw-r--r-- | dhall/src/syntax/ast/expr.rs | 4 | ||||
-rw-r--r-- | dhall/src/syntax/ast/span.rs | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/dhall/src/syntax/ast/expr.rs b/dhall/src/syntax/ast/expr.rs index 089c178..ce0a3d2 100644 --- a/dhall/src/syntax/ast/expr.rs +++ b/dhall/src/syntax/ast/expr.rs @@ -1,3 +1,5 @@ +use std::collections::BTreeMap; + use crate::semantics::Universe; use crate::syntax::map::{DupTreeMap, DupTreeSet}; use crate::syntax::visitor; @@ -165,7 +167,7 @@ pub enum ExprKind<SubExpr> { /// `{ k1 : t1, k2 : t1 }` RecordType(DupTreeMap<Label, SubExpr>), /// `{ k1 = v1, k2 = v2 }` - RecordLit(DupTreeMap<Label, SubExpr>), + RecordLit(BTreeMap<Label, SubExpr>), /// `< k1 : t1, k2 >` UnionType(DupTreeMap<Label, Option<SubExpr>>), /// `merge x y : t` diff --git a/dhall/src/syntax/ast/span.rs b/dhall/src/syntax/ast/span.rs index e75ea53..6d017f6 100644 --- a/dhall/src/syntax/ast/span.rs +++ b/dhall/src/syntax/ast/span.rs @@ -18,6 +18,8 @@ pub(crate) struct ParsedSpan { pub(crate) enum Span { /// A location in the source text Parsed(ParsedSpan), + /// Desugaring of duplicate fields + DuplicateRecordFieldsSugar, /// For expressions obtained from decoding binary Decoded, /// For expressions constructed during normalization/typecheck |