Implement POSTEXE NODE locations

The following Location information has been added This is the information required for parse.y to be a universal parser:

```
❯ ruby --parser=prism --dump=parsetree -e "END {  }"
@ ProgramNode (location: (1,0)-(1,8))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,8))
    +-- body: (length: 1)
        +-- @ PostExecutionNode (location: (1,0)-(1,8))
            +-- statements: nil
            +-- keyword_loc: (1,0)-(1,3) = "END"
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            +-- opening_loc: (1,4)-(1,5) = "{"
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            +-- closing_loc: (1,7)-(1,8) = "}"
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
This commit is contained in:
ydah 2024-11-02 15:46:49 +09:00 committed by Yudai Takada
parent 617e8608b2
commit a47e686cb6
5 changed files with 28 additions and 5 deletions

View file

@ -961,6 +961,9 @@ typedef struct RNode_POSTEXE {
NODE node;
struct RNode *nd_body;
rb_code_location_t keyword_loc;
rb_code_location_t opening_loc;
rb_code_location_t closing_loc;
} rb_node_postexe_t;
typedef struct RNode_SYM {