#[repr(C)]pub struct SwitchStatement<'gc> {
pub metadata: NodeMetadata<'gc>,
pub discriminant: &'gc Node<'gc>,
pub cases: NodeList<'gc>,
pub label_index: Cell<u32>,
pub scope: Cell<Option<SemaId>>,
}Expand description
The SwitchStatement AST node.
Fields§
§metadata: NodeMetadata<'gc>Source range, debug location, paren count, and node id.
discriminant: &'gc Node<'gc>ESTree discriminant property.
cases: NodeList<'gc>ESTree cases property.
label_index: Cell<u32>Sema: label index; INVALID_LABEL until set.
scope: Cell<Option<SemaId>>Sema: the lexical scope created by this node, if any.
Implementations§
Source§impl<'gc> SwitchStatement<'gc>
impl<'gc> SwitchStatement<'gc>
Sourcepub fn new(
metadata: NodeMetadata<'gc>,
discriminant: &'gc Node<'gc>,
cases: NodeList<'gc>,
) -> Self
pub fn new( metadata: NodeMetadata<'gc>, discriminant: &'gc Node<'gc>, cases: NodeList<'gc>, ) -> Self
Build SwitchStatement from its metadata and ESTree.def fields.
Decoration fields start at their defaults.
Trait Implementations§
Auto Trait Implementations§
impl<'gc> !Freeze for SwitchStatement<'gc>
impl<'gc> !RefUnwindSafe for SwitchStatement<'gc>
impl<'gc> !Send for SwitchStatement<'gc>
impl<'gc> !Sync for SwitchStatement<'gc>
impl<'gc> !UnwindSafe for SwitchStatement<'gc>
impl<'gc> Unpin for SwitchStatement<'gc>
impl<'gc> UnsafeUnpin for SwitchStatement<'gc>
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