Skip to main content

BlockCnt

Struct BlockCnt 

Source
pub struct BlockCnt {
Show 13 fields pub previous: Option<Box<BlockCnt>>, pub firstlabel: i32, pub firstgoto: i32, pub nactvar: u8, pub scope_level: u8, pub upval: bool, pub isloop: bool, pub insidetbc: bool, pub saved_global_strict: bool, pub saved_declared_globals: usize, pub saved_global_wildcard: bool, pub saved_global_wildcard_const: bool, pub saved_scope_barriers: usize,
}
Expand description

In C: stack-allocated, chained via raw *previous pointer. In Rust: heap-allocated in an Option<Box<BlockCnt>> chain on FuncState.

Fields§

§previous: Option<Box<BlockCnt>>§firstlabel: i32§firstgoto: i32§nactvar: u8§scope_level: u8§upval: bool§isloop: bool§insidetbc: bool§saved_global_strict: bool

Lua 5.5: the global-declaration scope state (LexState global_strict and the length of declared_globals) saved on block entry and restored on exit, so a global declaration is scoped to its enclosing block — e.g. do global x end does not leak strict mode past the block.

§saved_declared_globals: usize§saved_global_wildcard: bool

Lua 5.5: the global * wildcard flag saved on block entry and restored on exit, so a global * is scoped to its enclosing block.

§saved_global_wildcard_const: bool§saved_scope_barriers: usize

Trait Implementations§

Source§

impl Debug for BlockCnt

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.