aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/conditional.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/makefile/conditional.rs')
-rw-r--r--src/makefile/conditional.rs14
1 files changed, 7 insertions, 7 deletions
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<ConditionalState>) {
+ pub fn apply_to(self, stack: &mut Vec<ConditionalState>) {
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<String>,
) -> anyhow::Result<Option<Self>> {
@@ -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,