From fff4c46e09d4edf25eba737f4d71bfdb1dbf4a82 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 6 Apr 2020 22:11:54 +0100 Subject: Extract operation-related code to a new module --- dhall/src/syntax/ast/expr.rs | 65 ++------------------------------------------ 1 file changed, 2 insertions(+), 63 deletions(-) (limited to 'dhall/src/syntax/ast/expr.rs') diff --git a/dhall/src/syntax/ast/expr.rs b/dhall/src/syntax/ast/expr.rs index 51e9ea7..62734bf 100644 --- a/dhall/src/syntax/ast/expr.rs +++ b/dhall/src/syntax/ast/expr.rs @@ -1,8 +1,9 @@ use std::collections::BTreeMap; use crate::error::Error; +use crate::operations::OpKind; use crate::semantics::Universe; -use crate::syntax::map::{DupTreeMap, DupTreeSet}; +use crate::syntax::map::DupTreeMap; use crate::syntax::visitor; use crate::syntax::*; @@ -126,29 +127,6 @@ pub enum NumKind { Double(Double), } -/// Operations -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -pub enum OpKind { - /// `f a` - App(SubExpr, SubExpr), - /// Binary operations - BinOp(BinOp, SubExpr, SubExpr), - /// `if x then y else z` - BoolIf(SubExpr, SubExpr, SubExpr), - /// `merge x y : t` - Merge(SubExpr, SubExpr, Option), - /// `toMap x : t` - ToMap(SubExpr, Option), - /// `e.x` - Field(SubExpr, Label), - /// `e.{ x, y, z }` - Projection(SubExpr, DupTreeSet