Skip to content

Commit 45eee80

Browse files
committed
Extend parsing fixture for for
1 parent 5685bca commit 45eee80

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

spec/truffle/parsing/fixtures/for_operator.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ notes: >
3535
1)) # frameSlot
3636
3737
(NilLiteralNode)
38+
39+
Note that both i and any local variable in the `for`'s body are declared in the outer scope.
3840
focused_on_node: "org.truffleruby.language.dispatch.RubyCallNode"
3941
ruby: |
4042
for i in [42, 100500]
43+
inner = 1
4144
end
4245
ast: |
4346
RubyCallNode
@@ -88,7 +91,7 @@ ast: |
8891
WriteLocalVariableNode
8992
attributes:
9093
flags = 0
91-
frameSlot = 0
94+
frameSlot = 0 # (self)
9295
children:
9396
valueNode =
9497
ProfileArgumentNodeGen
@@ -102,7 +105,7 @@ ast: |
102105
WriteLocalVariableNode
103106
attributes:
104107
flags = 0
105-
frameSlot = 1
108+
frameSlot = 1 # %for_0
106109
children:
107110
valueNode =
108111
ProfileArgumentNodeGen
@@ -126,11 +129,19 @@ ast: |
126129
ReadLocalVariableNode
127130
attributes:
128131
flags = 0
129-
frameSlot = 1
132+
frameSlot = 1 # %for_0
130133
type = FRAME_LOCAL
131-
NilLiteralNode
134+
WriteDeclarationVariableNode
132135
attributes:
133-
flags = 0
136+
flags = 1
137+
frameDepth = 1
138+
frameSlot = 5
139+
children:
140+
valueNode =
141+
IntegerFixnumLiteralNode
142+
attributes:
143+
flags = 0
144+
value = 1
134145
]
135146
receiver =
136147
ArrayLiteralNode$UninitialisedArrayLiteralNode

0 commit comments

Comments
 (0)