summaryrefslogtreecommitdiff
path: root/dhall/src/syntax/ast/expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'dhall/src/syntax/ast/expr.rs')
-rw-r--r--dhall/src/syntax/ast/expr.rs23
1 files changed, 6 insertions, 17 deletions
diff --git a/dhall/src/syntax/ast/expr.rs b/dhall/src/syntax/ast/expr.rs
index a479b53..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`
@@ -237,32 +239,19 @@ impl<SE> ExprKind<SE> {
}
impl Expr {
- pub fn as_ref(&self) -> &UnspannedExpr {
+ pub(crate) fn as_ref(&self) -> &UnspannedExpr {
&self.kind
}
pub fn kind(&self) -> &UnspannedExpr {
&self.kind
}
- pub fn span(&self) -> Span {
+ pub(crate) fn span(&self) -> Span {
self.span.clone()
}
- pub fn new(kind: UnspannedExpr, span: Span) -> Self {
- Expr {
- kind: Box::new(kind),
- span,
- }
- }
-
- pub fn rewrap(&self, kind: UnspannedExpr) -> Expr {
+ pub(crate) fn new(kind: UnspannedExpr, span: Span) -> Self {
Expr {
kind: Box::new(kind),
- span: self.span.clone(),
- }
- }
- pub fn with_span(self, span: Span) -> Self {
- Expr {
- kind: self.kind,
span,
}
}