diff options
| author | ydah <t.yudai92@gmail.com> | 2024-11-11 01:00:05 +0900 |
|---|---|---|
| committer | Yudai Takada <t.yudai92@gmail.com> | 2025-01-09 18:24:56 +0900 |
| commit | c721301132507c58dbef4f9bab0188a79f691e3c (patch) | |
| tree | e101e86f401b3a6c75837390cc1f457bbf390864 /include/ruby/assert.h | |
| parent | 841555245d770df88a0c8079fc97a51ffa7ef8e9 (diff) | |
Implement FOR 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 "for a in b do end"
@ ProgramNode (location: (1,0)-(1,17))
+-- locals: [:a]
+-- statements:
@ StatementsNode (location: (1,0)-(1,17))
+-- body: (length: 1)
+-- @ ForNode (location: (1,0)-(1,17))
+-- index:
| @ LocalVariableTargetNode (location: (1,4)-(1,5))
| +-- name: :a
| +-- depth: 0
+-- collection:
| @ CallNode (location: (1,9)-(1,10))
| +-- CallNodeFlags: variable_call, ignore_visibility
| +-- receiver: nil
| +-- call_operator_loc: nil
| +-- name: :b
| +-- message_loc: (1,9)-(1,10) = "b"
| +-- opening_loc: nil
| +-- arguments: nil
| +-- closing_loc: nil
| +-- block: nil
+-- statements: nil
+-- for_keyword_loc: (1,0)-(1,3) = "for"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- in_keyword_loc: (1,6)-(1,8) = "in"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- do_keyword_loc: (1,11)-(1,13) = "do"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- end_keyword_loc: (1,14)-(1,17) = "end"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
Diffstat (limited to 'include/ruby/assert.h')
0 files changed, 0 insertions, 0 deletions
