[][src]Struct darklua_core::process::processors::FindVariables

pub struct FindVariables<'a> { /* fields omitted */ }

A processor to find usage of a given set of identifiers.

Example

The following example illustrate how you can use this processor to find usage of the foo variable.

let variables = vec!["foo".to_owned()];
let mut find_foo = FindVariables::from(&variables);

let mut foo_expression = Expression::Identifier("foo".to_owned());
DefaultVisitor::visit_expression(&mut foo_expression, &mut find_foo);

assert!(find_foo.has_found_usage());

If you pass a node that does not contain the given variable, the processor will return false when calling the has_found_usage() method.

let mut bar_expression = Expression::Identifier("bar".to_owned());
DefaultVisitor::visit_expression(&mut bar_expression, &mut find_foo);

assert!(!find_foo.has_found_usage());

Implementations

impl<'a> FindVariables<'a>[src]

pub fn has_found_usage(&self) -> bool[src]

Trait Implementations

impl<'a> From<&'a Vec<String>> for FindVariables<'a>[src]

impl<'a> NodeProcessor for FindVariables<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for FindVariables<'a>

impl<'a> Send for FindVariables<'a>

impl<'a> Sync for FindVariables<'a>

impl<'a> Unpin for FindVariables<'a>

impl<'a> UnwindSafe for FindVariables<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.