diff options
author | Nadrieril | 2019-03-06 12:19:26 +0100 |
---|---|---|
committer | Nadrieril | 2019-03-06 12:19:26 +0100 |
commit | 564a5f37b106c69d8ebe9aec2f665f5222b3dfda (patch) | |
tree | 21779d5ea3bc5daaec7fa214402868cde101cfce /dhall/src | |
parent | 5b32c5bdea80a0bdf19240f3cc2b8e2ae251d51a (diff) |
Split-off core into its own crate
Diffstat (limited to '')
-rw-r--r-- | dhall/src/lib.rs | 7 | ||||
-rw-r--r-- | dhall/src/main.rs | 1 | ||||
-rw-r--r-- | dhall/src/typecheck.rs | 14 | ||||
-rw-r--r-- | dhall_core/src/core.rs (renamed from dhall/src/core.rs) | 0 | ||||
-rw-r--r-- | dhall_core/src/grammar.lalrpop (renamed from dhall/src/grammar.lalrpop) | 0 | ||||
-rw-r--r-- | dhall_core/src/grammar_util.rs (renamed from dhall/src/grammar_util.rs) | 0 | ||||
-rw-r--r-- | dhall_core/src/lexer.rs (renamed from dhall/src/lexer.rs) | 0 | ||||
-rw-r--r-- | dhall_core/src/parser.rs (renamed from dhall/src/parser.rs) | 0 |
8 files changed, 8 insertions, 14 deletions
diff --git a/dhall/src/lib.rs b/dhall/src/lib.rs index 7cc96e1..902df53 100644 --- a/dhall/src/lib.rs +++ b/dhall/src/lib.rs @@ -2,11 +2,4 @@ #![feature(trace_macros)] pub mod context; -mod core; -pub use crate::core::*; -use lalrpop_util::lalrpop_mod; -lalrpop_mod!(pub grammar); -mod grammar_util; -pub mod lexer; -pub mod parser; pub mod typecheck; diff --git a/dhall/src/main.rs b/dhall/src/main.rs index 78a2905..3e8aca4 100644 --- a/dhall/src/main.rs +++ b/dhall/src/main.rs @@ -3,6 +3,7 @@ use std::io::{self, Read}; use term_painter::ToStyle; use dhall::*; +use dhall_core::*; const ERROR_STYLE: term_painter::Color = term_painter::Color::Red; const BOLD: term_painter::Attr = term_painter::Attr::Bold; diff --git a/dhall/src/typecheck.rs b/dhall/src/typecheck.rs index 976293d..61a83e7 100644 --- a/dhall/src/typecheck.rs +++ b/dhall/src/typecheck.rs @@ -4,12 +4,12 @@ use std::collections::HashSet; use std::fmt; use crate::context::Context; -use crate::core; -use crate::core::Builtin::*; -use crate::core::Const::*; -use crate::core::Expr::*; -use crate::core::{app, pi}; -use crate::core::{bx, normalize, shift, subst, Expr, V, X}; +use dhall_core::core; +use dhall_core::core::Builtin::*; +use dhall_core::core::Const::*; +use dhall_core::core::Expr::*; +use dhall_core::core::{app, pi}; +use dhall_core::core::{bx, normalize, shift, subst, Expr, V, X}; use self::TypeMessage::*; @@ -184,7 +184,7 @@ pub fn type_with<'i, S>( where S: Clone + ::std::fmt::Debug + 'i, { - use crate::BinOp::*; + use dhall_core::BinOp::*; match *e { Const(c) => axiom(c).map(Const), //.map(Cow::Owned), Var(V(x, n)) => { diff --git a/dhall/src/core.rs b/dhall_core/src/core.rs index 340cb04..340cb04 100644 --- a/dhall/src/core.rs +++ b/dhall_core/src/core.rs diff --git a/dhall/src/grammar.lalrpop b/dhall_core/src/grammar.lalrpop index 1ffe2ff..1ffe2ff 100644 --- a/dhall/src/grammar.lalrpop +++ b/dhall_core/src/grammar.lalrpop diff --git a/dhall/src/grammar_util.rs b/dhall_core/src/grammar_util.rs index ce73444..ce73444 100644 --- a/dhall/src/grammar_util.rs +++ b/dhall_core/src/grammar_util.rs diff --git a/dhall/src/lexer.rs b/dhall_core/src/lexer.rs index 5fc0f05..5fc0f05 100644 --- a/dhall/src/lexer.rs +++ b/dhall_core/src/lexer.rs diff --git a/dhall/src/parser.rs b/dhall_core/src/parser.rs index 6b20c01..6b20c01 100644 --- a/dhall/src/parser.rs +++ b/dhall_core/src/parser.rs |