Struct ruby_prism_sys::pm_scope
source · #[repr(C)]pub struct pm_scope {
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,
}Expand description
This struct represents a node in a linked list of scopes. Some scopes can see into their parent scopes, while others cannot.
Fields§
§locals: pm_constant_id_list_tThe IDs of the locals in the given scope.
previous: *mut pm_scopeA pointer to the previous scope in the linked list.
closed: boolA 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: boolA boolean indicating whether or not this scope has explicit parameters. This is necessary to determine whether or not numbered parameters are allowed.
forwarding_params: u8Booleans 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: u8An 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.