summaryrefslogtreecommitdiff
path: root/dhall_syntax/src/core
diff options
context:
space:
mode:
authorNadrieril Feneanar2019-08-10 23:15:13 +0200
committerGitHub2019-08-10 23:15:13 +0200
commitb41e0278eda19a495daf0586693f1b5981a89653 (patch)
treecedc8ca740ca0d0bbc74fc987cc0c041f0391b91 /dhall_syntax/src/core
parent674fbdc33c788156f76d263b044dccc48c810870 (diff)
parent80c8d87db595c91293af75d710464ac5379c7e28 (diff)
Merge pull request #98 from Nadrieril/catchup-spec
Catchup spec
Diffstat (limited to 'dhall_syntax/src/core')
-rw-r--r--dhall_syntax/src/core/expr.rs6
-rw-r--r--dhall_syntax/src/core/visitor.rs1
2 files changed, 6 insertions, 1 deletions
diff --git a/dhall_syntax/src/core/expr.rs b/dhall_syntax/src/core/expr.rs
index b293357..6522cb1 100644
--- a/dhall_syntax/src/core/expr.rs
+++ b/dhall_syntax/src/core/expr.rs
@@ -44,7 +44,7 @@ impl From<NaiveDouble> for f64 {
}
/// Constants for a pure type system
-#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub enum Const {
Type,
Kind,
@@ -99,6 +99,8 @@ pub enum BinOp {
BoolEQ,
/// `x != y`
BoolNE,
+ /// x === y
+ Equivalence,
}
/// Built-ins
@@ -175,6 +177,8 @@ pub enum ExprF<SubExpr, Embed> {
Let(Label, Option<SubExpr>, SubExpr, SubExpr),
/// `x : t`
Annot(SubExpr, SubExpr),
+ /// `assert : t`
+ Assert(SubExpr),
/// Built-in values
Builtin(Builtin),
// Binary operations
diff --git a/dhall_syntax/src/core/visitor.rs b/dhall_syntax/src/core/visitor.rs
index 68ad956..18f76d9 100644
--- a/dhall_syntax/src/core/visitor.rs
+++ b/dhall_syntax/src/core/visitor.rs
@@ -148,6 +148,7 @@ where
),
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)?),
Embed(a) => return v.visit_embed_squash(a),
})
}