mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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:
parent
7aa0e09bfe
commit
bcd21053f7
5 changed files with 21 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue