diff options
author | ydah <[email protected]> | 2024-11-04 23:32:00 +0900 |
---|---|---|
committer | Yudai Takada <[email protected]> | 2025-01-04 07:34:25 +0900 |
commit | 4c192011422dc04902ddf930ff22be223325a35d () | |
tree | 040fced96644259bd80af515e6ca1adc145cd3df /node_dump.c | |
parent | 34ee062d74ebfcbd04a0f2be2cdfda9cd8d20716 (diff) |
Implement EVSTR 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,8)) +-- locals: [] +-- statements: @ StatementsNode (location: (1,0)-(1,8)) +-- body: (length: 1) +-- @ InterpolatedStringNode (location: (1,0)-(1,8)) +-- InterpolatedStringNodeFlags: nil +-- opening_loc: (1,0)-(1,1) = "\"" +-- parts: (length: 1) | +-- @ EmbeddedStatementsNode (location: (1,1)-(1,7)) | +-- opening_loc: (1,1)-(1,3) = "\#{" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | +-- statements: | | @ StatementsNode (location: (1,3)-(1,6)) | | +-- body: (length: 1) | | +-- @ CallNode (location: (1,3)-(1,6)) | | +-- CallNodeFlags: variable_call, ignore_visibility | | +-- receiver: nil | | +-- call_operator_loc: nil | | +-- name: :foo | | +-- message_loc: (1,3)-(1,6) = "foo" | | +-- opening_loc: nil | | +-- arguments: nil | | +-- closing_loc: nil | | +-- block: nil | +-- closing_loc: (1,6)-(1,7) = "}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-- closing_loc: (1,7)-(1,8) = "\"" ```
-rw-r--r-- | node_dump.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -882,8 +882,10 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node) ANN("interpolation expression"); ANN("format: \"..#{ [nd_body] }..\""); ANN("example: \"foo#{ bar }baz\""); - LAST_NODE; F_NODE(nd_body, RNODE_EVSTR, "body"); return; case NODE_ARGSCAT: |