Struct lib_ruby_parser::nodes::Casgn [−][src]
#[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 = 1Noneif 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: StringName 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: LocLocation 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: LocLocation of the full expression
A = 1
~~~~~Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Casgn
impl UnwindSafe for Casgn
Blanket Implementations
Mutably borrows from an owned value. Read more