Skip to content

Commit c5dfc10

Browse files
eregonandrykonchin
authored andcommitted
Do not set RubyNode source section if startOffset==0 && length==0
* As that means a synthetic node with unknown location.
1 parent de97f0c commit c5dfc10

File tree

48 files changed

+127
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+127
-122
lines changed

spec/truffle/parsing/fixtures/END.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ast: |
2222
breakID = org.truffleruby.language.control.BreakID@...
2323
flags = 0
2424
isWhile = false
25-
sourceCharIndex = 0
25+
sourceCharIndex = -1
2626
sourceLength = 0
2727
children:
2828
body =
@@ -55,7 +55,7 @@ ast: |
5555
BooleanLiteralNode
5656
attributes:
5757
flags = 0
58-
sourceCharIndex = 0
58+
sourceCharIndex = -1
5959
sourceLength = 0
6060
value = false
6161
]
@@ -67,7 +67,7 @@ ast: |
6767
flags = 0
6868
frameOnStackMarkerSlot = 2
6969
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 0, 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 = [])
70-
sourceCharIndex = 0
70+
sourceCharIndex = -1
7171
sourceLength = 0
7272
type = PROC
7373
call targets:
@@ -131,7 +131,7 @@ ast: |
131131
attributes:
132132
flags = 0
133133
name = "KernelOperations"
134-
sourceCharIndex = 0
134+
sourceCharIndex = -1
135135
sourceLength = 0
136136
children:
137137
moduleNode =
@@ -140,7 +140,7 @@ ast: |
140140
flags = 0
141141
lexicalScope = :: Object
142142
name = "Truffle"
143-
sourceCharIndex = 0
143+
sourceCharIndex = -1
144144
sourceLength = 0
145145
children:
146146
getConstantNode =

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ 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 = 0
99+
sourceCharIndex = -1
100100
sourceLength = 0
101101
type = PROC
102102
call targets:
@@ -168,7 +168,7 @@ ast: |
168168
MultipleAssignmentNode
169169
attributes:
170170
flags = 0
171-
sourceCharIndex = 0
171+
sourceCharIndex = -1
172172
sourceLength = 0
173173
children:
174174
preNodes = [
@@ -199,7 +199,7 @@ ast: |
199199
attributes:
200200
flags = 0
201201
frameSlot = 1 # %for_0
202-
sourceCharIndex = 0
202+
sourceCharIndex = -1
203203
sourceLength = 0
204204
type = FRAME_LOCAL
205205
splatCastNode =

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ 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 = 0
99+
sourceCharIndex = -1
100100
sourceLength = 0
101101
type = PROC
102102
call targets:
@@ -168,7 +168,7 @@ ast: |
168168
MultipleAssignmentNode
169169
attributes:
170170
flags = 0
171-
sourceCharIndex = 0
171+
sourceCharIndex = -1
172172
sourceLength = 0
173173
children:
174174
preNodes = [
@@ -216,7 +216,7 @@ ast: |
216216
attributes:
217217
flags = 0
218218
frameSlot = 1 # %for_0
219-
sourceCharIndex = 0
219+
sourceCharIndex = -1
220220
sourceLength = 0
221221
type = FRAME_LOCAL
222222
splatCastNode =

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ 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 = 0
99+
sourceCharIndex = -1
100100
sourceLength = 0
101101
type = PROC
102102
call targets:
@@ -168,7 +168,7 @@ ast: |
168168
MultipleAssignmentNode
169169
attributes:
170170
flags = 0
171-
sourceCharIndex = 0
171+
sourceCharIndex = -1
172172
sourceLength = 0
173173
children:
174174
postNodes = [
@@ -202,7 +202,7 @@ ast: |
202202
attributes:
203203
flags = 0
204204
frameSlot = 1 # %for_0
205-
sourceCharIndex = 0
205+
sourceCharIndex = -1
206206
sourceLength = 0
207207
type = FRAME_LOCAL
208208
splatCastNode =

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ 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 = 0
99+
sourceCharIndex = -1
100100
sourceLength = 0
101101
type = PROC
102102
call targets:
@@ -168,7 +168,7 @@ ast: |
168168
MultipleAssignmentNode
169169
attributes:
170170
flags = 0
171-
sourceCharIndex = 0
171+
sourceCharIndex = -1
172172
sourceLength = 0
173173
children:
174174
preNodes = [
@@ -185,7 +185,7 @@ ast: |
185185
attributes:
186186
flags = 0
187187
frameSlot = 1 # %for_0
188-
sourceCharIndex = 0
188+
sourceCharIndex = -1
189189
sourceLength = 0
190190
type = FRAME_LOCAL
191191
splatCastNode =

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ 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 = 0
99+
sourceCharIndex = -1
100100
sourceLength = 0
101101
type = PROC
102102
call targets:
@@ -168,7 +168,7 @@ ast: |
168168
MultipleAssignmentNode
169169
attributes:
170170
flags = 0
171-
sourceCharIndex = 0
171+
sourceCharIndex = -1
172172
sourceLength = 0
173173
children:
174174
preNodes = [
@@ -200,7 +200,7 @@ ast: |
200200
attributes:
201201
flags = 0
202202
frameSlot = 1 # %for_0
203-
sourceCharIndex = 0
203+
sourceCharIndex = -1
204204
sourceLength = 0
205205
type = FRAME_LOCAL
206206
splatCastNode =

0 commit comments

Comments
 (0)