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