Ruby 3.3.6p108 (2024-11-05 revision 75015d4c1f6965b5e85e96fb309f1f2129f933c0)
pm_line_node_t Struct Reference

Currently, the ADD_INSN family of macros expects a NODE as the second parameter. More...

Data Fields

NODE node
 
int lineno
 

Detailed Description

Currently, the ADD_INSN family of macros expects a NODE as the second parameter.

It uses this node to determine the line number and the node ID for the instruction.

Because prism does not use the NODE struct (or have node IDs for that matter) we need to generate a dummy node to pass to these macros. We also need to use the line number from the node to generate labels.

We use this struct to store the dummy node and the line number together so that we can use it while we're compiling code.

In the future, we'll need to eventually remove this dependency and figure out a more permanent solution. For the line numbers, this shouldn't be too much of a problem, we can redefine the ADD_INSN family of macros. For the node ID, we can probably replace it directly with the column information since we have that at the time that we're generating instructions. In theory this could make node ID unnecessary.

Definition at line 431 of file prism_compile.c.

Field Documentation

◆ lineno

int pm_line_node_t::lineno

Definition at line 433 of file prism_compile.c.

◆ node

NODE pm_line_node_t::node

Definition at line 432 of file prism_compile.c.


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