Skip to content

Commit 9fd5c24

Browse files
eregonandrykonchin
authored andcommitted
Correctly set the SourceSection of the for loop body
1 parent 39cd1d6 commit 9fd5c24

16 files changed

+65
-63
lines changed

spec/truffle/parsing/fixtures/for/multi_assignment/with_multiple_variables.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ ast: |
9696
flags = 0
9797
frameOnStackMarkerSlot = 6
9898
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 1, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = %for_0, type = req)])
99-
sourceCharIndex = -1
100-
sourceLength = 0
99+
sourceCharIndex = 27
100+
sourceLength = 24
101101
type = PROC
102102
call targets:
103103
RubyProcRootNode
@@ -118,8 +118,8 @@ ast: |
118118
SequenceNode
119119
attributes:
120120
flags = 12
121-
sourceCharIndex = 0
122-
sourceLength = -1
121+
sourceCharIndex = 27
122+
sourceLength = 24
123123
children:
124124
body = [
125125
WriteLocalVariableNode

spec/truffle/parsing/fixtures/for/multi_assignment/with_nested_multi_assignment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ ast: |
9696
flags = 0
9797
frameOnStackMarkerSlot = 6
9898
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 1, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = %for_0, type = req)])
99-
sourceCharIndex = -1
100-
sourceLength = 0
99+
sourceCharIndex = 29
100+
sourceLength = 24
101101
type = PROC
102102
call targets:
103103
RubyProcRootNode
@@ -118,8 +118,8 @@ ast: |
118118
SequenceNode
119119
attributes:
120120
flags = 12
121-
sourceCharIndex = 0
122-
sourceLength = -1
121+
sourceCharIndex = 29
122+
sourceLength = 24
123123
children:
124124
body = [
125125
WriteLocalVariableNode

spec/truffle/parsing/fixtures/for/multi_assignment/with_preceding_splat_operator_and_following_variables.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ ast: |
9696
flags = 0
9797
frameOnStackMarkerSlot = 6
9898
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 1, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = %for_0, type = req)])
99-
sourceCharIndex = -1
100-
sourceLength = 0
99+
sourceCharIndex = 28
100+
sourceLength = 24
101101
type = PROC
102102
call targets:
103103
RubyProcRootNode
@@ -118,8 +118,8 @@ ast: |
118118
SequenceNode
119119
attributes:
120120
flags = 12
121-
sourceCharIndex = 0
122-
sourceLength = -1
121+
sourceCharIndex = 28
122+
sourceLength = 24
123123
children:
124124
body = [
125125
WriteLocalVariableNode

spec/truffle/parsing/fixtures/for/multi_assignment/with_preceding_variables_and_implicit_rest.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ ast: |
9696
flags = 0
9797
frameOnStackMarkerSlot = 4
9898
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 1, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = %for_0, type = req)])
99-
sourceCharIndex = -1
100-
sourceLength = 0
99+
sourceCharIndex = 22
100+
sourceLength = 12
101101
type = PROC
102102
call targets:
103103
RubyProcRootNode
@@ -118,8 +118,8 @@ ast: |
118118
SequenceNode
119119
attributes:
120120
flags = 12
121-
sourceCharIndex = 0
122-
sourceLength = -1
121+
sourceCharIndex = 22
122+
sourceLength = 12
123123
children:
124124
body = [
125125
WriteLocalVariableNode

spec/truffle/parsing/fixtures/for/multi_assignment/with_preceding_variables_and_splat_operator.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ ast: |
9696
flags = 0
9797
frameOnStackMarkerSlot = 6
9898
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 1, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = %for_0, type = req)])
99-
sourceCharIndex = -1
100-
sourceLength = 0
99+
sourceCharIndex = 28
100+
sourceLength = 24
101101
type = PROC
102102
call targets:
103103
RubyProcRootNode
@@ -118,8 +118,8 @@ ast: |
118118
SequenceNode
119119
attributes:
120120
flags = 12
121-
sourceCharIndex = 0
122-
sourceLength = -1
121+
sourceCharIndex = 28
122+
sourceLength = 24
123123
children:
124124
body = [
125125
WriteLocalVariableNode

spec/truffle/parsing/fixtures/for/multi_assignment/with_splat_operator_and_following_variables.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ ast: |
9696
flags = 0
9797
frameOnStackMarkerSlot = 6
9898
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 1, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = %for_0, type = req)])
99-
sourceCharIndex = -1
100-
sourceLength = 0
99+
sourceCharIndex = 28
100+
sourceLength = 24
101101
type = PROC
102102
call targets:
103103
RubyProcRootNode
@@ -118,8 +118,8 @@ ast: |
118118
SequenceNode
119119
attributes:
120120
flags = 12
121-
sourceCharIndex = 0
122-
sourceLength = -1
121+
sourceCharIndex = 28
122+
sourceLength = 24
123123
children:
124124
body = [
125125
WriteLocalVariableNode

spec/truffle/parsing/fixtures/for/with_attribute_assignment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ ast: |
9696
flags = 0
9797
frameOnStackMarkerSlot = 3
9898
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 1, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = %for_0, type = req)])
99-
sourceCharIndex = -1
100-
sourceLength = 0
99+
sourceCharIndex = 25
100+
sourceLength = 16
101101
type = PROC
102102
call targets:
103103
RubyProcRootNode
@@ -118,8 +118,8 @@ ast: |
118118
SequenceNode
119119
attributes:
120120
flags = 12
121-
sourceCharIndex = 0
122-
sourceLength = -1
121+
sourceCharIndex = 25
122+
sourceLength = 16
123123
children:
124124
body = [
125125
WriteLocalVariableNode

spec/truffle/parsing/fixtures/for/with_class_variable.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ ast: |
9696
flags = 0
9797
frameOnStackMarkerSlot = 3
9898
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 1, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = %for_0, type = req)])
99-
sourceCharIndex = -1
100-
sourceLength = 0
99+
sourceCharIndex = 23
100+
sourceLength = 14
101101
type = PROC
102102
call targets:
103103
RubyProcRootNode
@@ -118,8 +118,8 @@ ast: |
118118
SequenceNode
119119
attributes:
120120
flags = 12
121-
sourceCharIndex = 0
122-
sourceLength = -1
121+
sourceCharIndex = 23
122+
sourceLength = 14
123123
children:
124124
body = [
125125
WriteLocalVariableNode

0 commit comments

Comments
 (0)