Skip to main content

Evaluator

Struct Evaluator 

Source
pub struct Evaluator { /* private fields */ }

Implementations§

Source§

impl Evaluator

Source

pub fn new(predefined: &BTreeMap<String, String>) -> Self

Source

pub fn expand(&self, input: &str) -> Expansion

Source

pub fn assign( &mut self, variable: &Variable, location: EvaluationLocation, activity: Truth, )

Source

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.

Source

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.

Source

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.

Source

pub fn undefine(&mut self, name: &str, activity: Truth)

Source

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.

Source

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.

Source

pub fn condition(&self, kind: ConditionalKind, expression: &str) -> Truth

Source

pub fn flavor(&self, name: &str) -> Option<VariableFlavor>

Source

pub fn is_defined(&self, name: &str) -> bool

Source

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.

Trait Implementations§

Source§

impl Clone for Evaluator

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Evaluator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Evaluator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.