<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/ast.c, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Check for NULL fields in TYPEDDATA memsize functions (#15633)</title>
<updated>2025-12-18T20:42:49+00:00</updated>
<author>
<name>Luke Gruber</name>
<email>luke.gruber@shopify.com</email>
</author>
<published>2025-12-18T20:42:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=aace29d485559e38ca06923a6af335dbb5fb28f1'/>
<id>aace29d485559e38ca06923a6af335dbb5fb28f1</id>
<content type='text'>
Some TYPEDDATA objects allocate struct fields using the GC right after
they get created, and in that case the VM can try to perform a GC and join
a barrier if another ractor started one. If we're dumping the heap in another
ractor, this acquires a barrier and it will call the `rb_obj_memsize` function on this
object. We can't assume these struct fields are non-null. This also goes for C extensions,
which may cause problems with heap dumping from a ractor if their memsize functions aren't
coded correctly to check for NULL fields. Because dumping the heap from a ractor is likely a
rare scenario and it has only recently been introduced, we'll have to see how this works in
practice and if it causes bugs.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some TYPEDDATA objects allocate struct fields using the GC right after
they get created, and in that case the VM can try to perform a GC and join
a barrier if another ractor started one. If we're dumping the heap in another
ractor, this acquires a barrier and it will call the `rb_obj_memsize` function on this
object. We can't assume these struct fields are non-null. This also goes for C extensions,
which may cause problems with heap dumping from a ractor if their memsize functions aren't
coded correctly to check for NULL fields. Because dumping the heap from a ractor is likely a
rare scenario and it has only recently been introduced, we'll have to see how this works in
practice and if it causes bugs.</pre>
</div>
</content>
</entry>
<entry>
<title>Add NODE SCLASS locations</title>
<updated>2025-08-30T13:41:23+00:00</updated>
<author>
<name>S-H-GAMELINKS</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2025-08-30T12:26:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=dd4e7801f3f2b7e258016b8e22c6d8870516166b'/>
<id>dd4e7801f3f2b7e258016b8e22c6d8870516166b</id>
<content type='text'>
Add locations to struct `RNode_SCLASS`.

memo:

```
@ ProgramNode (location: (1,0)-(1,18))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,18))
    +-- body: (length: 1)
        +-- @ SingletonClassNode (location: (1,0)-(1,18))
            +-- locals: []
            +-- class_keyword_loc: (1,0)-(1,5) = "class"
            +-- operator_loc: (1,6)-(1,8) = "&lt;&lt;"
            +-- expression:
            |   @ SelfNode (location: (1,9)-(1,13))
            +-- body: nil
            +-- end_keyword_loc: (1,15)-(1,18) = "end"
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add locations to struct `RNode_SCLASS`.

memo:

```
@ ProgramNode (location: (1,0)-(1,18))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,18))
    +-- body: (length: 1)
        +-- @ SingletonClassNode (location: (1,0)-(1,18))
            +-- locals: []
            +-- class_keyword_loc: (1,0)-(1,5) = "class"
            +-- operator_loc: (1,6)-(1,8) = "&lt;&lt;"
            +-- expression:
            |   @ SelfNode (location: (1,9)-(1,13))
            +-- body: nil
            +-- end_keyword_loc: (1,15)-(1,18) = "end"
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Add NODE IN locations</title>
<updated>2025-08-11T13:25:47+00:00</updated>
<author>
<name>S-H-GAMELINKS</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2025-08-10T12:30:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4775d1ffa8a34f0bca3f6124c98426d56eb8e1b6'/>
<id>4775d1ffa8a34f0bca3f6124c98426d56eb8e1b6</id>
<content type='text'>
Add locations to struct `RNode_IN`.

memo:

```bash
&gt; ruby -e 'case 1; in 2 then 3; end' --parser=prism --dump=parsetree
@ ProgramNode (location: (1,0)-(1,24))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,24))
    +-- body: (length: 1)
        +-- @ CaseMatchNode (location: (1,0)-(1,24))
            +-- predicate:
            |   @ IntegerNode (location: (1,5)-(1,6))
            |   +-- IntegerBaseFlags: decimal
            |   +-- value: 1
            +-- conditions: (length: 1)
            |   +-- @ InNode (location: (1,8)-(1,19))
            |       +-- pattern:
            |       |   @ IntegerNode (location: (1,11)-(1,12))
            |       |   +-- IntegerBaseFlags: decimal
            |       |   +-- value: 2
            |       +-- statements:
            |       |   @ StatementsNode (location: (1,18)-(1,19))
            |       |   +-- body: (length: 1)
            |       |       +-- @ IntegerNode (location: (1,18)-(1,19))
            |       |           +-- IntegerBaseFlags: decimal
            |       |           +-- value: 3
            |       +-- in_loc: (1,8)-(1,10) = "in"
            |       +-- then_loc: (1,13)-(1,17) = "then"
            +-- else_clause: nil
            +-- case_keyword_loc: (1,0)-(1,4) = "case"
            +-- end_keyword_loc: (1,21)-(1,24) = "end"
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add locations to struct `RNode_IN`.

memo:

```bash
&gt; ruby -e 'case 1; in 2 then 3; end' --parser=prism --dump=parsetree
@ ProgramNode (location: (1,0)-(1,24))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,24))
    +-- body: (length: 1)
        +-- @ CaseMatchNode (location: (1,0)-(1,24))
            +-- predicate:
            |   @ IntegerNode (location: (1,5)-(1,6))
            |   +-- IntegerBaseFlags: decimal
            |   +-- value: 1
            +-- conditions: (length: 1)
            |   +-- @ InNode (location: (1,8)-(1,19))
            |       +-- pattern:
            |       |   @ IntegerNode (location: (1,11)-(1,12))
            |       |   +-- IntegerBaseFlags: decimal
            |       |   +-- value: 2
            |       +-- statements:
            |       |   @ StatementsNode (location: (1,18)-(1,19))
            |       |   +-- body: (length: 1)
            |       |       +-- @ IntegerNode (location: (1,18)-(1,19))
            |       |           +-- IntegerBaseFlags: decimal
            |       |           +-- value: 3
            |       +-- in_loc: (1,8)-(1,10) = "in"
            |       +-- then_loc: (1,13)-(1,17) = "then"
            +-- else_clause: nil
            +-- case_keyword_loc: (1,0)-(1,4) = "case"
            +-- end_keyword_loc: (1,21)-(1,24) = "end"
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Add MODULE NODE locations</title>
<updated>2025-08-06T16:07:16+00:00</updated>
<author>
<name>S-H-GAMELINKS</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2025-07-26T01:31:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bcd21053f733a93a82a34c6f5c23d6af2a8010ed'/>
<id>bcd21053f733a93a82a34c6f5c23d6af2a8010ed</id>
<content type='text'>
Add `keyword_module` amd `keyword_end` locations to struct `RNode_MODULE`.

memo:
```
&gt;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
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add `keyword_module` amd `keyword_end` locations to struct `RNode_MODULE`.

memo:
```
&gt;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
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Add NODE_DEFINED tests for cases with parentheses to test_ast.rb</title>
<updated>2025-07-24T16:07:32+00:00</updated>
<author>
<name>ydah</name>
<email>t.yudai92@gmail.com</email>
</author>
<published>2025-07-24T14:39:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b2838bef693db39960ca5e326e61408b4721b7bb'/>
<id>b2838bef693db39960ca5e326e61408b4721b7bb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add DEFINED NODE locations</title>
<updated>2025-07-24T14:30:23+00:00</updated>
<author>
<name>S-H-GAMELINKS</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2025-07-24T12:59:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fd492a45eb747f49d1f35c09332b654ada0280dc'/>
<id>fd492a45eb747f49d1f35c09332b654ada0280dc</id>
<content type='text'>
Add keyword_defined locations to struct RNode_DEFINED
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add keyword_defined locations to struct RNode_DEFINED
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement COLON3 NODE locations</title>
<updated>2025-06-15T13:37:20+00:00</updated>
<author>
<name>ydah</name>
<email>t.yudai92@gmail.com</email>
</author>
<published>2024-11-02T16:43:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d60144a4908b9bd64f7cd635defaa68b2abf2638'/>
<id>d60144a4908b9bd64f7cd635defaa68b2abf2638</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement COLON2 NODE locations</title>
<updated>2025-06-15T13:37:20+00:00</updated>
<author>
<name>ydah</name>
<email>t.yudai92@gmail.com</email>
</author>
<published>2024-11-02T16:29:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c584790bde83bfd6a01ebc9301f2fe00e4986ad7'/>
<id>c584790bde83bfd6a01ebc9301f2fe00e4986ad7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement CLASS NODE locations</title>
<updated>2025-03-08T09:26:40+00:00</updated>
<author>
<name>ydah</name>
<email>t.yudai92@gmail.com</email>
</author>
<published>2024-11-03T14:52:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=eae0fe37c08b568c0a7cbf904caba4faca517746'/>
<id>eae0fe37c08b568c0a7cbf904caba4faca517746</id>
<content type='text'>
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 "class A &lt; B; end"
@ ProgramNode (location: (1,0)-(1,16))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,16))
    +-- body: (length: 1)
        +-- @ ClassNode (location: (1,0)-(1,16))
            +-- locals: []
            +-- class_keyword_loc: (1,0)-(1,5) = "class"
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            +-- constant_path:
            |   @ ConstantReadNode (location: (1,6)-(1,7))
            |   +-- name: :A
            +-- inheritance_operator_loc: (1,8)-(1,9) = "&lt;"
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            +-- superclass:
            |   @ ConstantReadNode (location: (1,10)-(1,11))
            |   +-- name: :B
            +-- body: nil
            +-- end_keyword_loc: (1,13)-(1,16) = "end"
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            +-- name: :A
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 "class A &lt; B; end"
@ ProgramNode (location: (1,0)-(1,16))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,16))
    +-- body: (length: 1)
        +-- @ ClassNode (location: (1,0)-(1,16))
            +-- locals: []
            +-- class_keyword_loc: (1,0)-(1,5) = "class"
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            +-- constant_path:
            |   @ ConstantReadNode (location: (1,6)-(1,7))
            |   +-- name: :A
            +-- inheritance_operator_loc: (1,8)-(1,9) = "&lt;"
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            +-- superclass:
            |   @ ConstantReadNode (location: (1,10)-(1,11))
            |   +-- name: :B
            +-- body: nil
            +-- end_keyword_loc: (1,13)-(1,16) = "end"
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            +-- name: :A
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement POSTEXE NODE locations</title>
<updated>2025-03-03T02:17:14+00:00</updated>
<author>
<name>ydah</name>
<email>t.yudai92@gmail.com</email>
</author>
<published>2024-11-02T06:46:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a47e686cb6195dbd1266229d6e8d6bb17207c311'/>
<id>a47e686cb6195dbd1266229d6e8d6bb17207c311</id>
<content type='text'>
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) = "}"
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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) = "}"
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
</pre>
</div>
</content>
</entry>
</feed>
