From 9666eea62b8cf763027d1f01acbb403c1c6097e0 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Wed, 31 Mar 2021 13:23:32 -0600 Subject: issuing correction on a previous post of mine, regarding pub(crate) --- src/makefile/conditional.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/makefile/conditional.rs') diff --git a/src/makefile/conditional.rs b/src/makefile/conditional.rs index bf373bd..a3c3e0d 100644 --- a/src/makefile/conditional.rs +++ b/src/makefile/conditional.rs @@ -1,6 +1,6 @@ use super::token::TokenString; -pub(crate) enum ConditionalLine { +pub enum ConditionalLine { /// spelled "ifeq" IfEqual(TokenString, TokenString), /// spelled "ifneq" @@ -17,7 +17,7 @@ pub(crate) enum ConditionalLine { EndIf, } -pub(crate) enum ConditionalState { +pub enum ConditionalState { /// we saw a conditional, the condition was true, we're executing now /// and if we hit an else we will start SkippingUntilEndIf Executing, @@ -32,7 +32,7 @@ pub(crate) enum ConditionalState { } impl ConditionalState { - pub(crate) const fn skipping(&self) -> bool { + pub const fn skipping(&self) -> bool { match self { Self::Executing => false, Self::SkippingUntilElseOrEndIf | Self::SkippingUntilEndIf => true, @@ -40,14 +40,14 @@ impl ConditionalState { } } -pub(crate) enum ConditionalStateAction { +pub enum ConditionalStateAction { Push(ConditionalState), Replace(ConditionalState), Pop, } impl ConditionalStateAction { - pub(crate) fn apply_to(self, stack: &mut Vec) { + pub fn apply_to(self, stack: &mut Vec) { match self { Self::Push(state) => stack.push(state), Self::Replace(state) => match stack.last_mut() { @@ -78,7 +78,7 @@ fn decode_condition_args(line_body: &str) -> Option<(TokenString, TokenString)> } impl ConditionalLine { - pub(crate) fn from( + pub fn from( line: &str, expand_macro: impl Fn(&TokenString) -> anyhow::Result, ) -> anyhow::Result> { @@ -110,7 +110,7 @@ impl ConditionalLine { })) } - pub(crate) fn action( + pub fn action( &self, current_state: Option<&ConditionalState>, is_macro_defined: impl Fn(&str) -> bool, -- cgit v1.2.3