aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/functions.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-31 13:23:32 -0600
committerMelody Horn <melody@boringcactus.com>2021-03-31 13:23:32 -0600
commit9666eea62b8cf763027d1f01acbb403c1c6097e0 (patch)
treefb7f825089323ac8ef19203e7ff80f41156ce01b /src/makefile/functions.rs
parent9d3e0824a0966c648e951e5928c241700ee931fb (diff)
downloadmakers-9666eea62b8cf763027d1f01acbb403c1c6097e0.tar.gz
makers-9666eea62b8cf763027d1f01acbb403c1c6097e0.zip
issuing correction on a previous post of mine, regarding pub(crate)
Diffstat (limited to 'src/makefile/functions.rs')
-rw-r--r--src/makefile/functions.rs24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/makefile/functions.rs b/src/makefile/functions.rs
index 880ee7f..c73d7e7 100644
--- a/src/makefile/functions.rs
+++ b/src/makefile/functions.rs
@@ -2,11 +2,7 @@ use super::pattern::r#match;
use super::r#macro::{MacroSet, MacroSource};
use super::token::TokenString;
-pub(crate) fn expand_call(
- name: &str,
- args: &[TokenString],
- macros: &MacroSet,
-) -> anyhow::Result<String> {
+pub fn expand_call(name: &str, args: &[TokenString], macros: &MacroSet) -> anyhow::Result<String> {
match name {
"filter" => {
assert_eq!(args.len(), 2);
@@ -67,7 +63,7 @@ mod text {
use super::MacroSet;
use super::TokenString;
- pub(crate) fn filter(
+ pub fn filter(
macros: &MacroSet,
patterns: &TokenString,
text: &TokenString,
@@ -88,7 +84,7 @@ mod text {
Ok(result_pieces.join(" "))
}
- pub(crate) fn filter_out(
+ pub fn filter_out(
macros: &MacroSet,
patterns: &TokenString,
text: &TokenString,
@@ -109,7 +105,7 @@ mod text {
Ok(result_pieces.join(" "))
}
- pub(crate) fn sort(macros: &MacroSet, words: &TokenString) -> anyhow::Result<String> {
+ pub fn sort(macros: &MacroSet, words: &TokenString) -> anyhow::Result<String> {
let words = macros.expand(words)?;
let mut words = words.split_whitespace().collect::<Vec<_>>();
words.sort_unstable();
@@ -129,7 +125,7 @@ mod file_name {
use super::MacroSet;
use super::TokenString;
- pub(crate) fn notdir(macros: &MacroSet, words: &TokenString) -> anyhow::Result<String> {
+ pub fn notdir(macros: &MacroSet, words: &TokenString) -> anyhow::Result<String> {
let words = macros.expand(words)?;
let words = words
.split_whitespace()
@@ -143,7 +139,7 @@ mod file_name {
Ok(words.join(" "))
}
- pub(crate) fn basename(macros: &MacroSet, words: &TokenString) -> anyhow::Result<String> {
+ pub fn basename(macros: &MacroSet, words: &TokenString) -> anyhow::Result<String> {
let words = macros.expand(words)?;
let words = words
.split_whitespace()
@@ -157,7 +153,7 @@ mod file_name {
Ok(words.join(" "))
}
- pub(crate) fn addprefix(
+ pub fn addprefix(
macros: &MacroSet,
prefix: &TokenString,
targets: &TokenString,
@@ -171,7 +167,7 @@ mod file_name {
Ok(results.join(" "))
}
- pub(crate) fn wildcard(macros: &MacroSet, pattern: &TokenString) -> anyhow::Result<String> {
+ pub fn wildcard(macros: &MacroSet, pattern: &TokenString) -> anyhow::Result<String> {
let pattern = macros.expand(pattern)?;
let home_dir = env::var("HOME")
.ok()
@@ -198,7 +194,7 @@ mod foreach {
use super::MacroSource;
use super::TokenString;
- pub(crate) fn foreach(
+ pub fn foreach(
macros: &MacroSet,
var: &TokenString,
list: &TokenString,
@@ -225,7 +221,7 @@ mod call {
use super::MacroSource;
use super::TokenString;
- pub(crate) fn call<'a>(
+ pub fn call<'a>(
macros: &MacroSet,
args: impl Iterator<Item = &'a TokenString>,
) -> anyhow::Result<String> {