Skip to content

Commit 45ff6fd

Browse files
committed
Introduce yarp_specific attribute in YAML fixtures to skip some cases for JRuby parser
There are some cases when Truffle AST generated for YARP and for JRuby parser are different and we don't backport the change to BodyTranslator but don't want these test cases to be excluded as failed
1 parent 1db38f5 commit 45ff6fd

12 files changed

+184
-191
lines changed

spec/tags/truffle/parsing/parsing_tags.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,6 @@ fails:Parsing a Rescue keyword (backtrace optimization / disabled / when rescue
214214
fails:Parsing a Rescue keyword (backtrace optimization / disabled / when rescue section is Regexp (... rescue /a/)) case is parsed correctly
215215
fails:Parsing a Rescue keyword (backtrace optimization / enabled / when rescue section is __FILE__ constant (... rescue __FILE__)) case is parsed correctly
216216
fails:Parsing a Rescue keyword (backtrace optimization / enabled / when rescue section is local variable defined in outer scope (... rescue a)) case is parsed correctly
217-
fails:Parsing a Rescue keyword (capturing / with an attribute) case is parsed correctly
218-
fails:Parsing a Rescue keyword (capturing / with a class variable) case is parsed correctly
219-
fails:Parsing a Rescue keyword (capturing / with a constant) case is parsed correctly
220-
fails:Parsing a Rescue keyword (capturing / with a constant with lexical parent (A::B)) case is parsed correctly
221-
fails:Parsing a Rescue keyword (capturing / with a fully qualified constant (::A)) case is parsed correctly
222-
fails:Parsing a Rescue keyword (capturing / with a constant with fully qualified lexical parent (::A::B)) case is parsed correctly
223-
fails:Parsing a Rescue keyword (capturing / with element reference) case is parsed correctly
224-
fails:Parsing a Rescue keyword (capturing / with a global variable) case is parsed correctly
225-
fails:Parsing a Rescue keyword (capturing / with an instance variable) case is parsed correctly
226-
fails:Parsing a Rescue keyword (capturing / with a local variable) case is parsed correctly
227217
fails:Parsing a Rescue keyword (rescue in a do/end block) case is parsed correctly
228218
fails:Parsing a Rescue keyword (rescue in a method) case is parsed correctly
229219
fails:Parsing a Rescue keyword (modifier / backtrace optimization / disabled / when rescue section is Range (... rescue 1..3)) case is parsed correctly

spec/truffle/parsing/fixtures/rescue/capturing/with_attribute.yaml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
subject: "Rescue keyword"
22
description: "capturing / with an attribute"
3+
yarp_specific: true
34
notes: >
45
Capturing exception to a setter is represented as a `a.foo=()` method call.
56
@@ -54,55 +55,54 @@ ast: |
5455
flags = 0
5556
children:
5657
body = [
57-
RubyCallNode
58+
AssignRescueVariableNode
5859
attributes:
59-
descriptor = org.truffleruby.language.arguments.EmptyArgumentsDescriptor@...
60-
dispatchConfig = PROTECTED
61-
emptyKeywordsProfile = false
6260
flags = 0
63-
isAttrAssign = true
64-
isSafeNavigation = false
65-
isSplatted = false
66-
isVCall = false
67-
lastArgIsNotHashProfile = false
68-
methodName = "foo="
69-
notEmptyKeywordsProfile = false
70-
notRuby2KeywordsHashProfile = false
71-
ruby2KeywordsHashProfile = false
7261
children:
73-
arguments = [
74-
ReadGlobalVariableNodeGen
75-
attributes:
76-
flags = 0
77-
name = "$!"
78-
children:
79-
lookupGlobalVariableStorageNode =
80-
LookupGlobalVariableStorageNodeGen
81-
attributes:
82-
index = -1
83-
name = "$!"
84-
]
85-
receiver =
62+
rescueVariableNode =
8663
RubyCallNode
8764
attributes:
8865
descriptor = org.truffleruby.language.arguments.EmptyArgumentsDescriptor@...
89-
dispatchConfig = PRIVATE
66+
dispatchConfig = PROTECTED
9067
emptyKeywordsProfile = false
9168
flags = 0
92-
isAttrAssign = false
69+
isAttrAssign = true
9370
isSafeNavigation = false
9471
isSplatted = false
95-
isVCall = true
72+
isVCall = false
9673
lastArgIsNotHashProfile = false
97-
methodName = "a"
74+
methodName = "foo="
9875
notEmptyKeywordsProfile = false
9976
notRuby2KeywordsHashProfile = false
10077
ruby2KeywordsHashProfile = false
10178
children:
79+
arguments = [
80+
DeadNode
81+
attributes:
82+
flags = 0
83+
reason = "YARPTranslator#translateRescueException"
84+
]
10285
receiver =
103-
SelfNode
86+
RubyCallNode
10487
attributes:
88+
descriptor = org.truffleruby.language.arguments.EmptyArgumentsDescriptor@...
89+
dispatchConfig = PRIVATE
90+
emptyKeywordsProfile = false
10591
flags = 0
92+
isAttrAssign = false
93+
isSafeNavigation = false
94+
isSplatted = false
95+
isVCall = true
96+
lastArgIsNotHashProfile = false
97+
methodName = "a"
98+
notEmptyKeywordsProfile = false
99+
notRuby2KeywordsHashProfile = false
100+
ruby2KeywordsHashProfile = false
101+
children:
102+
receiver =
103+
SelfNode
104+
attributes:
105+
flags = 0
106106
IntegerFixnumLiteralNode
107107
attributes:
108108
flags = 0

spec/truffle/parsing/fixtures/rescue/capturing/with_class_variable.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
subject: "Rescue keyword"
22
description: "capturing / with a class variable"
3+
yarp_specific: true
34
notes: >
45
A class variable capturing is represented with the following simplified AST:
56
@@ -52,31 +53,30 @@ ast: |
5253
flags = 0
5354
children:
5455
body = [
55-
WriteClassVariableNode
56+
AssignRescueVariableNode
5657
attributes:
5758
flags = 0
58-
name = "@@error"
5959
children:
60-
lexicalScopeNode =
61-
ObjectLiteralNode
60+
rescueVariableNode =
61+
WriteClassVariableNode
6262
attributes:
6363
flags = 0
64-
object = :: Object
65-
resolveTargetModuleNode =
66-
ResolveTargetModuleForClassVariablesNodeGen
67-
rhs =
68-
ReadGlobalVariableNodeGen
69-
attributes:
70-
flags = 0
71-
name = "$!"
64+
name = "@@error"
7265
children:
73-
lookupGlobalVariableStorageNode =
74-
LookupGlobalVariableStorageNodeGen
66+
lexicalScopeNode =
67+
ObjectLiteralNode
68+
attributes:
69+
flags = 0
70+
object = :: Object
71+
resolveTargetModuleNode =
72+
ResolveTargetModuleForClassVariablesNodeGen
73+
rhs =
74+
DeadNode
7575
attributes:
76-
index = -1
77-
name = "$!"
78-
setClassVariableNode =
79-
SetClassVariableNodeGen
76+
flags = 0
77+
reason = "YARPTranslator#visitClassVariableWriteNode"
78+
setClassVariableNode =
79+
SetClassVariableNodeGen
8080
IntegerFixnumLiteralNode
8181
attributes:
8282
flags = 0

spec/truffle/parsing/fixtures/rescue/capturing/with_constant.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
subject: "Rescue keyword"
22
description: "capturing / with a constant"
3+
yarp_specific: true
34
notes: >
45
A constant capturing is represented with the following simplified AST:
56
@@ -52,27 +53,26 @@ ast: |
5253
flags = 0
5354
children:
5455
body = [
55-
WriteConstantNode
56+
AssignRescueVariableNode
5657
attributes:
5758
flags = 0
58-
name = "ERROR"
5959
children:
60-
moduleNode =
61-
LexicalScopeNode
60+
rescueVariableNode =
61+
WriteConstantNode
6262
attributes:
6363
flags = 0
64-
lexicalScope = :: Object
65-
valueNode =
66-
ReadGlobalVariableNodeGen
67-
attributes:
68-
flags = 0
69-
name = "$!"
64+
name = "ERROR"
7065
children:
71-
lookupGlobalVariableStorageNode =
72-
LookupGlobalVariableStorageNodeGen
66+
moduleNode =
67+
LexicalScopeNode
68+
attributes:
69+
flags = 0
70+
lexicalScope = :: Object
71+
valueNode =
72+
DeadNode
7373
attributes:
74-
index = -1
75-
name = "$!"
74+
flags = 0
75+
reason = "YARPTranslator#visitConstantPathWriteNode"
7676
IntegerFixnumLiteralNode
7777
attributes:
7878
flags = 0

spec/truffle/parsing/fixtures/rescue/capturing/with_constant_and_lexical_parent.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
subject: "Rescue keyword"
22
description: "capturing / with a constant with lexical parent (A::B)"
3+
yarp_specific: true
34
notes: >
45
A constant capturing is represented with the following simplified AST:
56
@@ -52,36 +53,35 @@ ast: |
5253
flags = 0
5354
children:
5455
body = [
55-
WriteConstantNode
56+
AssignRescueVariableNode
5657
attributes:
5758
flags = 0
58-
name = "ERROR"
5959
children:
60-
moduleNode =
61-
ReadConstantWithLexicalScopeNode
60+
rescueVariableNode =
61+
WriteConstantNode
6262
attributes:
6363
flags = 0
64-
lexicalScope = :: Object
65-
name = "Foo"
64+
name = "ERROR"
6665
children:
67-
getConstantNode =
68-
GetConstantNodeGen
69-
lookupConstantNode =
70-
LookupConstantWithLexicalScopeNodeGen
66+
moduleNode =
67+
ReadConstantWithLexicalScopeNode
7168
attributes:
69+
flags = 0
7270
lexicalScope = :: Object
7371
name = "Foo"
74-
valueNode =
75-
ReadGlobalVariableNodeGen
76-
attributes:
77-
flags = 0
78-
name = "$!"
79-
children:
80-
lookupGlobalVariableStorageNode =
81-
LookupGlobalVariableStorageNodeGen
72+
children:
73+
getConstantNode =
74+
GetConstantNodeGen
75+
lookupConstantNode =
76+
LookupConstantWithLexicalScopeNodeGen
77+
attributes:
78+
lexicalScope = :: Object
79+
name = "Foo"
80+
valueNode =
81+
DeadNode
8282
attributes:
83-
index = -1
84-
name = "$!"
83+
flags = 0
84+
reason = "YARPTranslator#visitConstantPathWriteNode"
8585
IntegerFixnumLiteralNode
8686
attributes:
8787
flags = 0

0 commit comments

Comments
 (0)