From 78d066a44c5598794602effa4c10a09f80ed1e72 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 20 Dec 2019 17:57:49 +0000 Subject: Move error module to root of crate --- dhall/src/syntax/binary/decode.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dhall/src/syntax/binary/decode.rs') diff --git a/dhall/src/syntax/binary/decode.rs b/dhall/src/syntax/binary/decode.rs index 46c9921..f452666 100644 --- a/dhall/src/syntax/binary/decode.rs +++ b/dhall/src/syntax/binary/decode.rs @@ -2,7 +2,7 @@ use itertools::Itertools; use serde_cbor::value::value as cbor; use std::iter::FromIterator; -use crate::semantics::error::DecodeError; +use crate::error::DecodeError; use crate::semantics::phase::DecodedExpr; use crate::syntax; use crate::syntax::{ -- cgit v1.2.3 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/binary/decode.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dhall/src/syntax/binary/decode.rs') diff --git a/dhall/src/syntax/binary/decode.rs b/dhall/src/syntax/binary/decode.rs index f452666..8b73e46 100644 --- a/dhall/src/syntax/binary/decode.rs +++ b/dhall/src/syntax/binary/decode.rs @@ -6,7 +6,7 @@ use crate::error::DecodeError; use crate::semantics::phase::DecodedExpr; use crate::syntax; use crate::syntax::{ - Expr, ExprF, FilePath, FilePrefix, Hash, ImportLocation, ImportMode, + Expr, ExprKind, FilePath, FilePrefix, Hash, ImportLocation, ImportMode, Integer, InterpolatedText, Label, Natural, RawExpr, Scheme, Span, URL, V, }; @@ -25,10 +25,10 @@ fn rc(x: RawExpr) -> Expr { fn cbor_value_to_dhall(data: &cbor::Value) -> Result { use cbor::Value::*; use syntax::{BinOp, Builtin, Const}; - use ExprF::*; + use ExprKind::*; Ok(rc(match data { String(s) => match Builtin::parse(s) { - Some(b) => ExprF::Builtin(b), + Some(b) => ExprKind::Builtin(b), None => match s.as_str() { "True" => BoolLit(true), "False" => BoolLit(false), @@ -123,7 +123,7 @@ fn cbor_value_to_dhall(data: &cbor::Value) -> Result { } [U64(4), t] => { let t = cbor_value_to_dhall(&t)?; - EmptyListLit(rc(App(rc(ExprF::Builtin(Builtin::List)), t))) + EmptyListLit(rc(App(rc(ExprKind::Builtin(Builtin::List)), t))) } [U64(4), Null, rest @ ..] => { let rest = rest @@ -139,14 +139,14 @@ fn cbor_value_to_dhall(data: &cbor::Value) -> Result { // Old-style optional literals [U64(5), t] => { let t = cbor_value_to_dhall(&t)?; - App(rc(ExprF::Builtin(Builtin::OptionalNone)), t) + App(rc(ExprKind::Builtin(Builtin::OptionalNone)), t) } [U64(5), t, x] => { let x = cbor_value_to_dhall(&x)?; let t = cbor_value_to_dhall(&t)?; Annot( rc(SomeLit(x)), - rc(App(rc(ExprF::Builtin(Builtin::Optional)), t)), + rc(App(rc(ExprKind::Builtin(Builtin::Optional)), t)), ) } [U64(6), x, y] => { -- cgit v1.2.3 From 980e50f33a88559edcf8b12cdec91fd9bee84ca9 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 20 Dec 2019 19:01:07 +0000 Subject: s/RawExpr/UnspannedExpr/ --- dhall/src/syntax/binary/decode.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'dhall/src/syntax/binary/decode.rs') diff --git a/dhall/src/syntax/binary/decode.rs b/dhall/src/syntax/binary/decode.rs index 8b73e46..254ab07 100644 --- a/dhall/src/syntax/binary/decode.rs +++ b/dhall/src/syntax/binary/decode.rs @@ -7,7 +7,8 @@ use crate::semantics::phase::DecodedExpr; use crate::syntax; use crate::syntax::{ Expr, ExprKind, FilePath, FilePrefix, Hash, ImportLocation, ImportMode, - Integer, InterpolatedText, Label, Natural, RawExpr, Scheme, Span, URL, V, + Integer, InterpolatedText, Label, Natural, Scheme, Span, UnspannedExpr, + URL, V, }; pub(crate) fn decode(data: &[u8]) -> Result { @@ -18,7 +19,7 @@ pub(crate) fn decode(data: &[u8]) -> Result { } // Should probably rename this -fn rc(x: RawExpr) -> Expr { +fn rc(x: UnspannedExpr) -> Expr { Expr::new(x, Span::Decoded) } -- cgit v1.2.3