aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/makefile/mod.rs')
-rw-r--r--src/makefile/mod.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs
index 1ce335d..23243e4 100644
--- a/src/makefile/mod.rs
+++ b/src/makefile/mod.rs
@@ -29,17 +29,17 @@ enum MacroSource {
Builtin,
}
-pub struct Makefile<'a> {
+pub(crate) struct Makefile<'a> {
inference_rules: Vec<InferenceRule>,
macros: HashMap<String, (MacroSource, TokenString)>,
targets: RefCell<HashMap<String, Rc<RefCell<Target>>>>,
- pub first_non_special_target: Option<String>,
+ pub(crate) first_non_special_target: Option<String>,
args: &'a Args,
// TODO borrow warnings from Python version
}
impl<'a> Makefile<'a> {
- pub fn new(args: &'a Args) -> Self {
+ pub(crate) fn new(args: &'a Args) -> Self {
let mut inference_rules = vec![];
let mut macros = HashMap::new();
let mut targets = HashMap::new();
@@ -84,7 +84,7 @@ impl<'a> Makefile<'a> {
}
}
- pub fn and_read_file(&mut self, path: impl AsRef<Path>) {
+ pub(crate) fn and_read_file(&mut self, path: impl AsRef<Path>) {
let file = File::open(path);
// TODO handle errors
let file = file.expect("couldn't open makefile!");
@@ -92,7 +92,7 @@ impl<'a> Makefile<'a> {
self.and_read(file_reader);
}
- pub fn and_read(&mut self, source: impl BufRead) {
+ pub(crate) fn and_read(&mut self, source: impl BufRead) {
let mut lines_iter = source.lines().enumerate().peekable();
while let Some((line_number, line)) = lines_iter.next() {
// TODO handle I/O errors at all
@@ -369,7 +369,7 @@ impl<'a> Makefile<'a> {
}
}
- pub fn get_target(&self, name: &str) -> Rc<RefCell<Target>> {
+ pub(crate) fn get_target(&self, name: &str) -> Rc<RefCell<Target>> {
// TODO implement .POSIX
let follow_gnu = true;
@@ -467,7 +467,7 @@ impl<'a> Makefile<'a> {
targets.get(name).expect("Target not found!").clone()
}
- pub fn update_target(&self, name: &str) {
+ pub(crate) fn update_target(&self, name: &str) {
self.get_target(name).borrow().update(self);
}