From 7bbf42dc5d3727dffcb036ffe30dd433faff1950 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 21 Mar 2019 15:11:55 +0100 Subject: Reorganize dhall_core a bit --- dhall/src/imports.rs | 8 ++++---- dhall/src/main.rs | 2 +- dhall/src/normalize.rs | 2 +- dhall/tests/common/mod.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'dhall') diff --git a/dhall/src/imports.rs b/dhall/src/imports.rs index 22f7863..2435663 100644 --- a/dhall/src/imports.rs +++ b/dhall/src/imports.rs @@ -43,11 +43,11 @@ fn resolve_import( #[derive(Debug)] pub enum DhallError { - ParseError(parser::ParseError), + ParseError(ParseError), IOError(std::io::Error), } -impl From for DhallError { - fn from(e: parser::ParseError) -> Self { +impl From for DhallError { + fn from(e: ParseError) -> Self { DhallError::ParseError(e) } } @@ -72,7 +72,7 @@ pub fn load_dhall_file( ) -> Result, DhallError> { let mut buffer = String::new(); File::open(f)?.read_to_string(&mut buffer)?; - let expr = parser::parse_expr(&*buffer)?; + let expr = parse_expr(&*buffer)?; let expr = if resolve_imports { let root = ImportRoot::LocalDir(f.parent().unwrap().to_owned()); let resolve = |import: &Import| -> Expr { diff --git a/dhall/src/main.rs b/dhall/src/main.rs index 810d789..1a2e309 100644 --- a/dhall/src/main.rs +++ b/dhall/src/main.rs @@ -58,7 +58,7 @@ fn print_error(message: &str, source: &str, start: usize, end: usize) { fn main() { let mut buffer = String::new(); io::stdin().read_to_string(&mut buffer).unwrap(); - let expr = match parser::parse_expr(&buffer) { + let expr = match parse_expr(&buffer) { Ok(e) => e, Err(e) => { print_error(&format!("Parse error {}", e), &buffer, 0, 0); diff --git a/dhall/src/normalize.rs b/dhall/src/normalize.rs index 6257faf..7eba0cc 100644 --- a/dhall/src/normalize.rs +++ b/dhall/src/normalize.rs @@ -1,5 +1,5 @@ #![allow(non_snake_case)] -use dhall_core::core::*; +use dhall_core::*; use dhall_generator::dhall_expr; use std::fmt; use std::rc::Rc; diff --git a/dhall/tests/common/mod.rs b/dhall/tests/common/mod.rs index 75aee38..ffc6d06 100644 --- a/dhall/tests/common/mod.rs +++ b/dhall/tests/common/mod.rs @@ -76,7 +76,7 @@ pub fn run_test(base_path: &str, feature: Feature) { assert_eq_pretty!(expr, expected); // Round-trip pretty-printer - let expr = parser::parse_expr(&expr.to_string()).unwrap(); + let expr = parse_expr(&expr.to_string()).unwrap(); let expr = dhall::imports::panic_imports(&expr); assert_eq!(expr, expected); } -- cgit v1.2.3