#[repr(C)]pub struct pm_local_variable_read_node {
pub base: pm_node_t,
pub name: pm_constant_id_t,
pub depth: u32,
}Expand description
LocalVariableReadNode
Type: PM_LOCAL_VARIABLE_READ_NODE
@extends pm_node_t
Fields§
§base: pm_node_tThe embedded base node.
name: pm_constant_id_tLocalVariableReadNode#name
The name of the local variable, which is an identifier.
x # name `:x`
_Test # name `:_Test`
Note that this can also be an underscore followed by a number for the default block parameters.
_1 # name `:_1`
Finally, for the default it block parameter, the name is 0it. This is to distinguish it from an it local variable that is explicitly declared.
it # name `:0it`
depth: u32LocalVariableReadNode#depth
The number of visible scopes that should be searched to find the origin of this local variable.
foo = 1; foo # depth 0
bar = 2; tap { bar } # depth 1
The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see the Prism documentation.
Trait Implementations§
source§impl Clone for pm_local_variable_read_node
impl Clone for pm_local_variable_read_node
source§fn clone(&self) -> pm_local_variable_read_node
fn clone(&self) -> pm_local_variable_read_node
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for pm_local_variable_read_node
impl Debug for pm_local_variable_read_node
impl Copy for pm_local_variable_read_node
Auto Trait Implementations§
impl RefUnwindSafe for pm_local_variable_read_node
impl !Send for pm_local_variable_read_node
impl !Sync for pm_local_variable_read_node
impl Unpin for pm_local_variable_read_node
impl UnwindSafe for pm_local_variable_read_node
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more