[−][src]Struct darklua_core::process::processors::FindVariables
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]
fn process_variable_expression(&mut self, variable: &mut String)[src]
fn process_block(&mut self, _: &mut Block)[src]
fn process_statement(&mut self, _: &mut Statement)[src]
fn process_function_call(&mut self, _: &mut FunctionCall)[src]
fn process_assign_statement(&mut self, _: &mut AssignStatement)[src]
fn process_do_statement(&mut self, _: &mut DoStatement)[src]
fn process_function_statement(&mut self, _: &mut FunctionStatement)[src]
fn process_generic_for_statement(&mut self, _: &mut GenericForStatement)[src]
fn process_if_statement(&mut self, _: &mut IfStatement)[src]
fn process_last_statement(&mut self, _: &mut LastStatement)[src]
fn process_local_assign_statement(&mut self, _: &mut LocalAssignStatement)[src]
fn process_local_function_statement(&mut self, _: &mut LocalFunctionStatement)[src]
fn process_numeric_for_statement(&mut self, _: &mut NumericForStatement)[src]
fn process_repeat_statement(&mut self, _: &mut RepeatStatement)[src]
fn process_while_statement(&mut self, _: &mut WhileStatement)[src]
fn process_expression(&mut self, _: &mut Expression)[src]
fn process_binary_expression(&mut self, _: &mut BinaryExpression)[src]
fn process_field_expression(&mut self, _: &mut FieldExpression)[src]
fn process_function_expression(&mut self, _: &mut FunctionExpression)[src]
fn process_index_expression(&mut self, _: &mut IndexExpression)[src]
fn process_number_expression(&mut self, _: &mut NumberExpression)[src]
fn process_prefix_expression(&mut self, _: &mut Prefix)[src]
fn process_parenthese_expression(&mut self, _: &mut Expression)[src]
fn process_string_expression(&mut self, _: &mut StringExpression)[src]
fn process_table_expression(&mut self, _: &mut TableExpression)[src]
fn process_unary_expression(&mut self, _: &mut UnaryExpression)[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,