From 7848c8e8d3147ebe428290558aa6c0efcbf59ee5 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 18 Mar 2020 18:58:51 +0000 Subject: Brutally make all of dhall pub --- dhall/src/syntax/ast/span.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dhall/src/syntax/ast/span.rs') 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, /// # 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, sp: pest::Span) -> Self { + pub fn make(input: Rc, 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) { -- cgit v1.2.3