diff options
author | Nadrieril | 2019-03-21 15:11:55 +0100 |
---|---|---|
committer | Nadrieril | 2019-03-21 15:37:02 +0100 |
commit | 7bbf42dc5d3727dffcb036ffe30dd433faff1950 (patch) | |
tree | 16ec59df8c3a834e0c0380dd141c18e052453bb3 /dhall/src | |
parent | a304bce542c7685ca02e96e01143dcc69f920f36 (diff) |
Reorganize dhall_core a bit
Diffstat (limited to 'dhall/src')
-rw-r--r-- | dhall/src/imports.rs | 8 | ||||
-rw-r--r-- | dhall/src/main.rs | 2 | ||||
-rw-r--r-- | dhall/src/normalize.rs | 2 |
3 files changed, 6 insertions, 6 deletions
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<parser::ParseError> for DhallError { - fn from(e: parser::ParseError) -> Self { +impl From<ParseError> for DhallError { + fn from(e: ParseError) -> Self { DhallError::ParseError(e) } } @@ -72,7 +72,7 @@ pub fn load_dhall_file( ) -> Result<Expr<X, X>, 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<X, X> { 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; |