From 903d6c0bba36a6696eb337ae84b962f4cc48b5b5 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 4 Mar 2020 21:26:01 +0000 Subject: Implement remote imports and cleanup import chaining --- dhall/src/lib.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dhall/src/lib.rs') diff --git a/dhall/src/lib.rs b/dhall/src/lib.rs index 34d7bc3..d68ad6b 100644 --- a/dhall/src/lib.rs +++ b/dhall/src/lib.rs @@ -17,11 +17,12 @@ pub mod syntax; use std::fmt::Display; use std::path::Path; +use url::Url; use crate::error::{EncodeError, Error, TypeError}; use crate::semantics::parse; use crate::semantics::resolve; -use crate::semantics::resolve::ImportRoot; +use crate::semantics::resolve::ImportLocation; use crate::semantics::{ typecheck, typecheck_with, Hir, Nir, NirKind, Tir, Type, }; @@ -34,7 +35,7 @@ pub type ResolvedExpr = Expr; pub type NormalizedExpr = Expr; #[derive(Debug, Clone)] -pub struct Parsed(ParsedExpr, ImportRoot); +pub struct Parsed(ParsedExpr, ImportLocation); /// An expression where all imports have been resolved /// @@ -66,6 +67,9 @@ impl Parsed { pub fn parse_file(f: &Path) -> Result { parse::parse_file(f) } + pub fn parse_remote(url: Url) -> Result { + parse::parse_remote(url) + } pub fn parse_str(s: &str) -> Result { parse::parse_str(s) } -- cgit v1.2.3