Type Alias ruby_prism_sys::pm_scope_t

source ·
pub type pm_scope_t = pm_scope;
Expand description

This struct represents a node in a linked list of scopes. Some scopes can see into their parent scopes, while others cannot.

Aliased Type§

struct pm_scope_t {
    pub locals: pm_constant_id_list_t,
    pub previous: *mut pm_scope,
    pub closed: bool,
    pub explicit_params: bool,
    pub forwarding_params: u8,
    pub numbered_parameters: u8,
}

Fields§

§locals: pm_constant_id_list_t

The IDs of the locals in the given scope.

§previous: *mut pm_scope

A pointer to the previous scope in the linked list.

§closed: bool

A boolean indicating whether or not this scope can see into its parent. If closed is true, then the scope cannot see into its parent.

§explicit_params: bool

A boolean indicating whether or not this scope has explicit parameters. This is necessary to determine whether or not numbered parameters are allowed.

§forwarding_params: u8

Booleans indicating whether the parameters for this scope have declared forwarding parameters.

For example, some combinations of: def foo(*); end def foo(**); end def foo(&); end def foo(…); end

§numbered_parameters: u8

An integer indicating the number of numbered parameters on this scope. This is necessary to determine if child blocks are allowed to use numbered parameters, and to pass information to consumers of the AST about how many numbered parameters exist.