From e355984c3c83f8288eac36023c361db869643367 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 20 Dec 2019 18:12:10 +0000 Subject: s/ExprF/ExprKind/ --- dhall/src/syntax/ast/expr.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 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 5b9f401..7ac342d 100644 --- a/dhall/src/syntax/ast/expr.rs +++ b/dhall/src/syntax/ast/expr.rs @@ -1,5 +1,5 @@ use crate::syntax::map::{DupTreeMap, DupTreeSet}; -use crate::syntax::visitor::{self, ExprFMutVisitor, ExprFVisitor}; +use crate::syntax::visitor::{self, ExprKindMutVisitor, ExprKindVisitor}; use crate::syntax::*; pub type Integer = isize; @@ -144,7 +144,7 @@ pub enum Builtin { #[derive(Debug, Clone)] pub struct Expr(Box<(RawExpr, Span)>); -pub type RawExpr = ExprF, Embed>; +pub type RawExpr = ExprKind, Embed>; impl std::cmp::PartialEq for Expr { fn eq(&self, other: &Self) -> bool { @@ -168,7 +168,7 @@ impl std::hash::Hash for Expr { // much more generic code and improves pattern-matching behind // smart pointers. #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum ExprF { +pub enum ExprKind { Const(Const), /// `x` /// `x@n` @@ -231,12 +231,12 @@ pub enum ExprF { Embed(Embed), } -impl ExprF { +impl ExprKind { pub fn traverse_ref_with_special_handling_of_binders<'a, SE2, Err>( &'a self, visit_subexpr: impl FnMut(&'a SE) -> Result, visit_under_binder: impl FnOnce(&'a Label, &'a SE) -> Result, - ) -> Result, Err> + ) -> Result, Err> where E: Clone, { @@ -250,7 +250,7 @@ impl ExprF { fn traverse_ref<'a, SE2, Err>( &'a self, visit_subexpr: impl FnMut(&'a SE) -> Result, - ) -> Result, Err> + ) -> Result, Err> where E: Clone, { @@ -268,7 +268,7 @@ impl ExprF { &'a self, mut map_subexpr: impl FnMut(&'a SE) -> SE2, mut map_under_binder: impl FnMut(&'a Label, &'a SE) -> SE2, - ) -> ExprF + ) -> ExprKind where E: Clone, { @@ -281,7 +281,7 @@ impl ExprF { pub fn map_ref<'a, SE2>( &'a self, mut map_subexpr: impl FnMut(&'a SE) -> SE2, - ) -> ExprF + ) -> ExprKind where E: Clone, { @@ -321,8 +321,8 @@ impl Expr { F1: FnMut(Import>) -> Result, { match self.as_mut() { - ExprF::BinOp(BinOp::ImportAlt, l, r) => { - let garbage_expr = ExprF::BoolLit(false); + ExprKind::BinOp(BinOp::ImportAlt, l, r) => { + let garbage_expr = ExprKind::BoolLit(false); let new_self = if l.traverse_resolve_mut(f).is_ok() { l } else { @@ -334,7 +334,7 @@ impl Expr { } _ => { self.as_mut().traverse_mut(|e| e.traverse_resolve_mut(f))?; - if let ExprF::Import(import) = self.as_mut() { + if let ExprKind::Import(import) = self.as_mut() { let garbage_import = Import { mode: ImportMode::Code, location: ImportLocation::Missing, @@ -342,7 +342,7 @@ impl Expr { }; // Move out of &mut import let import = std::mem::replace(import, garbage_import); - *self.as_mut() = ExprF::Embed(f(import)?); + *self.as_mut() = ExprKind::Embed(f(import)?); } } } -- cgit v1.2.3