Struct lib_ruby_parser::nodes::Casgn
source · #[repr(C)]pub struct Casgn {
pub scope: Option<Box<Node>>,
pub name: String,
pub value: Option<Box<Node>>,
pub double_colon_l: Option<Loc>,
pub name_l: Loc,
pub operator_l: Option<Loc>,
pub expression_l: Loc,
}
Expand description
Represents a constant assignment (i.e. A = 1
)
Fields§
§scope: Option<Box<Node>>
Scope where the constant is defined:
Some(Const("A"))
forA::B = 1
None
if it’s defined in the current scope (i.e.A = 1
)Some(Cbase)
if it’s defined in the global scope (i.e.::A = 1
)
name: String
Name of the constant, String("A")
for A = 1
value: Option<Box<Node>>
Value that is assigned to a constant, Int("1")
for A = 1
.
Note: None
if constant assignment is a part of the multi-assignment.
In such case value
belongs to Masgn
node of the multi-assignment.
double_colon_l: Option<Loc>
Location of the ::
operator
A::B = 1
~~
::A = 1
~~
None
if the constant is defined in the current scope
name_l: Loc
Location of the constant name
A::CONST = 1
~~~~~
operator_l: Option<Loc>
Location of the =
operator
A = 1
~
None
if constant assignment is a part of the multi-assignment.
In such case =
belongs to a Masgn
node
expression_l: Loc
Location of the full expression
A = 1
~~~~~
Trait Implementations§
source§impl PartialEq for Casgn
impl PartialEq for Casgn
impl StructuralPartialEq for Casgn
Auto Trait Implementations§
impl Freeze for Casgn
impl RefUnwindSafe for Casgn
impl Send for Casgn
impl Sync for Casgn
impl Unpin for Casgn
impl UnwindSafe for Casgn
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