pub struct Evaluator { /* private fields */ }Implementations§
Source§impl Evaluator
impl Evaluator
pub fn new(predefined: &BTreeMap<String, String>) -> Self
pub fn expand(&self, input: &str) -> Expansion
pub fn assign( &mut self, variable: &Variable, location: EvaluationLocation, activity: Truth, )
Sourcepub fn read_too_early(&self) -> Vec<ReadTooEarly>
pub fn read_too_early(&self) -> Vec<ReadTooEarly>
Every name a definition read before a definition Make certainly reaches gives it a value, in the order Make read them. Answering this needs the whole reading, so it holds only once the project is loaded.
Sourcepub fn gives_a_value(&self, name: &str) -> bool
pub fn gives_a_value(&self, name: &str) -> bool
Whether the project gives name a value of its own somewhere, as
against a caller supplying it through the environment, the command line
or a parent make. undefine does not take this back: the project still
says what the name is worth.
Sourcepub fn gives_a_scoped_value(&mut self, name: &str)
pub fn gives_a_scoped_value(&mut self, name: &str)
Records that the project gives name a value while one rule runs. Make
holds it nowhere else, so it is a value the project gives and nothing
the evaluator can read.
pub fn undefine(&mut self, name: &str, activity: Truth)
Sourcepub fn definition_after(
&self,
name: &str,
definitions_read: usize,
) -> Option<EvaluationLocation>
pub fn definition_after( &self, name: &str, definitions_read: usize, ) -> Option<EvaluationLocation>
Where GNU Make next gives name a value, having read
definitions_read definitions already, and None where it reads no
further definition worth waiting for. Answering this needs the whole
reading, so it holds only once the project is loaded.
Sourcepub fn certain_definition_after(
&self,
name: &str,
definitions_read: usize,
) -> Option<EvaluationLocation>
pub fn certain_definition_after( &self, name: &str, definitions_read: usize, ) -> Option<EvaluationLocation>
Where GNU Make certainly gives name a value after definitions_read,
passing over the definitions it reaches only through a branch whose
condition it decides while it reads. Those say nothing about whether a
reading before them was too early, because Make may reach none of them.
pub fn condition(&self, kind: ConditionalKind, expression: &str) -> Truth
pub fn flavor(&self, name: &str) -> Option<VariableFlavor>
pub fn is_defined(&self, name: &str) -> bool
Sourcepub fn expand_as_undefined(
&self,
input: &str,
) -> Option<(String, Vec<UndefinedName>)>
pub fn expand_as_undefined( &self, input: &str, ) -> Option<(String, Vec<UndefinedName>)>
Expands input the way GNU Make expands it when variables it names
have no value here: such a reference contributes nothing to the text
around it. Returns the text Make produces and the variables that had no
value, in the order they were found.
None once anything but a valueless variable keeps the expression from
being expanded, because what Make produces is then genuinely unknown
rather than known to be the text without those references.