diff options
author | ydah <[email protected]> | 2024-11-05 14:13:29 +0900 |
---|---|---|
committer | Yudai Takada <[email protected]> | 2025-01-04 13:53:13 +0900 |
commit | 5fcc3ab534cb001a577a5c64381d3a31813344c9 () | |
tree | 62687d0f66759fbfa458f6c5182f320a57f2fbf5 /rubyparser.h | |
parent | fa2517451ec265d5b273e864bc750a1b9ba2957f (diff) |
Implement REGX 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 '/foo/' @ ProgramNode (location: (1,0)-(1,5)) +-- locals: [] +-- statements: @ StatementsNode (location: (1,0)-(1,5)) +-- body: (length: 1) +-- @ RegularExpressionNode (location: (1,0)-(1,5)) +-- RegularExpressionFlags: forced_us_ascii_encoding +-- opening_loc: (1,0)-(1,1) = "/" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-- content_loc: (1,1)-(1,4) = "foo" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-- closing_loc: (1,4)-(1,5) = "/" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-- unescaped: "foo" ```
-rw-r--r-- | rubyparser.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -737,6 +737,9 @@ typedef struct RNode_REGX { /* also RNode_MATCH */ struct rb_parser_string *string; int options; } rb_node_regx_t, rb_node_match_t; typedef rb_node_dstr_t rb_node_dregx_t; |