Add MODULE NODE locations

Add `keyword_module` amd `keyword_end` locations to struct `RNode_MODULE`.

memo:
```
>ruby --dump=parsetree -e 'module A end'
@ ProgramNode (location: (1,0)-(1,12))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,12))
    +-- body: (length: 1)
        +-- @ ModuleNode (location: (1,0)-(1,12))
            +-- locals: []
            +-- module_keyword_loc: (1,0)-(1,6) = "module"
            +-- constant_path:
            |   @ ConstantReadNode (location: (1,7)-(1,8))
            |   +-- name: :A
            +-- body: nil
            +-- end_keyword_loc: (1,9)-(1,12) = "end"
            +-- name: :A
```
This commit is contained in:
S-H-GAMELINKS 2025-07-26 10:31:23 +09:00 committed by Yudai Takada
parent 7aa0e09bfe
commit bcd21053f7
5 changed files with 21 additions and 5 deletions

View file

@ -901,6 +901,8 @@ typedef struct RNode_MODULE {
struct RNode *nd_cpath;
struct RNode *nd_body;
rb_code_location_t module_keyword_loc;
rb_code_location_t end_keyword_loc;
} rb_node_module_t;
typedef struct RNode_SCLASS {