Struct Scope

Source
pub struct Scope<'a> {
    pub identifiers: FxHashMap<Name<'a>, usize>,
}

Fields§

§identifiers: FxHashMap<Name<'a>, usize>

Implementations§

Source§

impl<'a> Scope<'a>

Check if an IR contains expressions that reference current context scope ids e.g. identifiers referenced in the scope can skip prefixing

Source

pub fn has_identifier(&self, id: Name<'a>) -> bool

Source

pub fn add_identifier(&mut self, id: Name<'a>)

Source

pub fn remove_identifier(&mut self, id: Name<'a>)

Source

pub fn has_ref_in_vnode(&self, node: &mut BaseVNode<'a>) -> bool

Trait Implementations§

Source§

impl<'a, 'b> CorePassExt<BaseConvertInfo<'a>, Scope<'a>> for ExpressionProcessor<'a, 'b>

Source§

fn enter_fn_param(&mut self, p: &mut Js<'a>, shared: &mut Scope<'a>)

Source§

fn exit_fn_param(&mut self, p: &mut Js<'a>, shared: &mut Scope<'a>)

Source§

fn exit_js_expr(&mut self, e: &mut Js<'a>, shared: &mut Scope<'a>)

Source§

fn enter_js_expr(&mut self, _: &mut T::JsExpression, _: &mut Shared)

Source§

fn enter_vnode(&mut self, _: &mut VNodeIR<T>, _: &mut Shared)

Source§

fn exit_vnode(&mut self, _: &mut VNodeIR<T>, _: &mut Shared)

Source§

impl<'a> CorePassExt<BaseConvertInfo<'a>, Scope<'a>> for SlotFlagMarker

Source§

fn exit_vnode(&mut self, v: &mut BaseVNode<'a>, scope: &mut Scope<'a>)

Source§

fn enter_js_expr(&mut self, _: &mut T::JsExpression, _: &mut Shared)

Source§

fn exit_js_expr(&mut self, _: &mut T::JsExpression, _: &mut Shared)

Source§

fn enter_fn_param(&mut self, _: &mut T::JsExpression, _: &mut Shared)

Source§

fn exit_fn_param(&mut self, _: &mut T::JsExpression, _: &mut Shared)

Source§

fn enter_vnode(&mut self, _: &mut VNodeIR<T>, _: &mut Shared)

Source§

impl<'a> Default for Scope<'a>

Source§

fn default() -> Scope<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Scope<'a>

§

impl<'a> RefUnwindSafe for Scope<'a>

§

impl<'a> Send for Scope<'a>

§

impl<'a> Sync for Scope<'a>

§

impl<'a> Unpin for Scope<'a>

§

impl<'a> UnwindSafe for Scope<'a>

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> Erasable for T

Source§

const ACK_1_1_0: bool = true

Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Source§

unsafe fn unerase(this: NonNull<Erased>) -> NonNull<T>

Unerase this erased pointer. Read more
Source§

fn erase(this: NonNull<Self>) -> NonNull<Erased>

Turn this erasable pointer into an erased pointer. 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.