summaryrefslogtreecommitdiff
path: root/dhall/src/syntax
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dhall/src/syntax/ast/expr.rs10
-rw-r--r--dhall/src/syntax/ast/mod.rs2
-rw-r--r--dhall/src/syntax/ast/span.rs12
-rw-r--r--dhall/src/syntax/ast/visitor.rs2
-rw-r--r--dhall/src/syntax/binary/decode.rs2
-rw-r--r--dhall/src/syntax/binary/encode.rs2
-rw-r--r--dhall/src/syntax/binary/mod.rs4
7 files changed, 17 insertions, 17 deletions
diff --git a/dhall/src/syntax/ast/expr.rs b/dhall/src/syntax/ast/expr.rs
index 2c1860e..6ba6649 100644
--- a/dhall/src/syntax/ast/expr.rs
+++ b/dhall/src/syntax/ast/expr.rs
@@ -22,7 +22,7 @@ pub enum Const {
}
impl Const {
- pub(crate) fn to_universe(self) -> Universe {
+ pub fn to_universe(self) -> Universe {
Universe::from_const(self)
}
}
@@ -205,7 +205,7 @@ impl<SE> ExprKind<SE> {
})
}
- pub(crate) fn traverse_ref<'a, SE2, Err>(
+ pub fn traverse_ref<'a, SE2, Err>(
&'a self,
mut visit_subexpr: impl FnMut(&'a SE) -> Result<SE2, Err>,
) -> Result<ExprKind<SE2>, Err> {
@@ -239,17 +239,17 @@ impl<SE> ExprKind<SE> {
}
impl Expr {
- pub(crate) fn as_ref(&self) -> &UnspannedExpr {
+ pub fn as_ref(&self) -> &UnspannedExpr {
&self.kind
}
pub fn kind(&self) -> &UnspannedExpr {
&self.kind
}
- pub(crate) fn span(&self) -> Span {
+ pub fn span(&self) -> Span {
self.span.clone()
}
- pub(crate) fn new(kind: UnspannedExpr, span: Span) -> Self {
+ pub fn new(kind: UnspannedExpr, span: Span) -> Self {
Expr {
kind: Box::new(kind),
span,
diff --git a/dhall/src/syntax/ast/mod.rs b/dhall/src/syntax/ast/mod.rs
index 5e20c5d..1950154 100644
--- a/dhall/src/syntax/ast/mod.rs
+++ b/dhall/src/syntax/ast/mod.rs
@@ -5,7 +5,7 @@ pub use import::*;
mod label;
pub use label::*;
mod span;
-pub(crate) use span::*;
+pub use span::*;
mod text;
pub use text::*;
pub mod map;
diff --git a/dhall/src/syntax/ast/span.rs b/dhall/src/syntax/ast/span.rs
index 2e09863..e250602 100644
--- a/dhall/src/syntax/ast/span.rs
+++ b/dhall/src/syntax/ast/span.rs
@@ -2,7 +2,7 @@ use std::rc::Rc;
/// A location in the source text
#[derive(Debug, Clone)]
-pub(crate) struct ParsedSpan {
+pub struct ParsedSpan {
input: Rc<str>,
/// # Safety
///
@@ -15,7 +15,7 @@ pub(crate) struct ParsedSpan {
}
#[derive(Debug, Clone)]
-pub(crate) enum Span {
+pub enum Span {
/// A location in the source text
Parsed(ParsedSpan),
/// Desugarings
@@ -30,12 +30,12 @@ pub(crate) enum Span {
}
impl ParsedSpan {
- pub(crate) fn to_input(&self) -> String {
+ pub fn to_input(&self) -> String {
self.input.to_string()
}
/// Convert to a char range for consumption by annotate_snippets.
/// This compensates for https://github.com/rust-lang/annotate-snippets-rs/issues/24
- pub(crate) fn as_char_range(&self) -> (usize, usize) {
+ pub fn as_char_range(&self) -> (usize, usize) {
(
char_idx_from_byte_idx(&self.input, self.start),
char_idx_from_byte_idx(&self.input, self.end),
@@ -44,7 +44,7 @@ impl ParsedSpan {
}
impl Span {
- pub(crate) fn make(input: Rc<str>, sp: pest::Span) -> Self {
+ pub fn make(input: Rc<str>, sp: pest::Span) -> Self {
Span::Parsed(ParsedSpan {
input,
start: sp.start(),
@@ -55,7 +55,7 @@ impl Span {
/// Takes the union of the two spans, i.e. the range of input covered by the two spans plus any
/// input between them. Assumes that the spans come from the same input. Fails if one of the
/// spans does not point to an input location.
- pub(crate) fn union(&self, other: &Span) -> Self {
+ pub fn union(&self, other: &Span) -> Self {
use std::cmp::{max, min};
use Span::*;
match (self, other) {
diff --git a/dhall/src/syntax/ast/visitor.rs b/dhall/src/syntax/ast/visitor.rs
index 0743af4..0a0c5ef 100644
--- a/dhall/src/syntax/ast/visitor.rs
+++ b/dhall/src/syntax/ast/visitor.rs
@@ -51,7 +51,7 @@ where
.collect()
}
-pub(crate) fn visit_ref<'a, F, SE1, SE2, Err>(
+pub fn visit_ref<'a, F, SE1, SE2, Err>(
input: &'a ExprKind<SE1>,
mut f: F,
) -> Result<ExprKind<SE2>, Err>
diff --git a/dhall/src/syntax/binary/decode.rs b/dhall/src/syntax/binary/decode.rs
index 0fd358e..3c93419 100644
--- a/dhall/src/syntax/binary/decode.rs
+++ b/dhall/src/syntax/binary/decode.rs
@@ -11,7 +11,7 @@ use crate::syntax::{
};
type DecodedExpr = Expr;
-pub(crate) fn decode(data: &[u8]) -> Result<DecodedExpr, DecodeError> {
+pub fn decode(data: &[u8]) -> Result<DecodedExpr, DecodeError> {
match serde_cbor::de::from_slice(data) {
Ok(v) => cbor_value_to_dhall(&v),
Err(e) => Err(DecodeError::CBORError(e)),
diff --git a/dhall/src/syntax/binary/encode.rs b/dhall/src/syntax/binary/encode.rs
index 5974f47..8d22a9b 100644
--- a/dhall/src/syntax/binary/encode.rs
+++ b/dhall/src/syntax/binary/encode.rs
@@ -10,7 +10,7 @@ use crate::syntax::{
Scheme, V,
};
-pub(crate) fn encode(expr: &Expr) -> Result<Vec<u8>, EncodeError> {
+pub fn encode(expr: &Expr) -> Result<Vec<u8>, EncodeError> {
serde_cbor::ser::to_vec(&Serialize::Expr(expr))
.map_err(EncodeError::CBORError)
}
diff --git a/dhall/src/syntax/binary/mod.rs b/dhall/src/syntax/binary/mod.rs
index 7ed1f6e..98e0520 100644
--- a/dhall/src/syntax/binary/mod.rs
+++ b/dhall/src/syntax/binary/mod.rs
@@ -1,4 +1,4 @@
mod decode;
mod encode;
-pub(crate) use decode::decode;
-pub(crate) use encode::encode;
+pub use decode::decode;
+pub use encode::encode;