Ruby 3.3.0p0 (2023-12-25 revision 5124f9ac7513eb590c37717337c430cb93caa151)
Data Fields
pm_scope Struct Reference

This struct represents a node in a linked list of scopes. More...

#include <parser.h>

Data Fields

pm_constant_id_list_t locals
 The IDs of the locals in the given scope.
 
struct pm_scopeprevious
 A pointer to the previous scope in the linked list.
 
bool closed
 A boolean indicating whether or not this scope can see into its parent.
 
bool explicit_params
 A boolean indicating whether or not this scope has explicit parameters.
 
uint8_t numbered_parameters
 An integer indicating the number of numbered parameters on this scope.
 

Detailed Description

This struct represents a node in a linked list of scopes.

Some scopes can see into their parent scopes, while others cannot.

Definition at line 454 of file parser.h.

Field Documentation

◆ closed

bool pm_scope::closed

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.

Definition at line 465 of file parser.h.

◆ explicit_params

bool pm_scope::explicit_params

A boolean indicating whether or not this scope has explicit parameters.

This is necessary to determine whether or not numbered parameters are allowed.

Definition at line 472 of file parser.h.

◆ locals

pm_constant_id_list_t pm_scope::locals

The IDs of the locals in the given scope.

Definition at line 456 of file parser.h.

Referenced by pm_parser_free().

◆ numbered_parameters

uint8_t pm_scope::numbered_parameters

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.

Definition at line 480 of file parser.h.

◆ previous

struct pm_scope* pm_scope::previous

A pointer to the previous scope in the linked list.

Definition at line 459 of file parser.h.


The documentation for this struct was generated from the following file: