Skip to content

Commit cdcaf82

Browse files
committed
Add YAML fixtures
1 parent 0502c3e commit cdcaf82

19 files changed

+1209
-12
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
subject: "Block"
2+
description: "Argument descriptors / with rejecting keyword arguments (**nil)"
3+
notes: >
4+
Method parameters are described (as ArgumentDescriptor[]) in the following way:
5+
- ArgumentDescriptor(name = null, type = nokey)
6+
7+
So the keyword arguments are described as `nokey` variables.
8+
focused_on_node: "org.truffleruby.language.methods.BlockDefinitionNode"
9+
ruby: |
10+
proc do |**nil|
11+
end
12+
ast: |
13+
BlockDefinitionNodeGen
14+
attributes:
15+
breakID = org.truffleruby.language.control.BreakID@...
16+
callTargets = ProcCallTargets(callTargetForProc = block in <top (required)>, callTargetForLambda = null, altCallTargetCompiler = ...$$Lambda$.../0x...@...)
17+
flags = 0
18+
frameOnStackMarkerSlot = 2
19+
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = true}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = null, type = nokey)])
20+
type = PROC
21+
call targets:
22+
RubyProcRootNode
23+
attributes:
24+
callTarget = block in <top (required)>
25+
frameDescriptor = FrameDescriptor@...{#0:(self)}
26+
instrumentationBits = 0
27+
lock = java.util.concurrent.locks.ReentrantLock@...[Unlocked]
28+
nextProfile = false
29+
polyglotRef = org.truffleruby.RubyLanguage@...
30+
redoProfile = false
31+
retryProfile = false
32+
returnID = org.truffleruby.language.control.ReturnID@...
33+
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = true}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = null, type = nokey)])
34+
split = HEURISTIC
35+
children:
36+
body =
37+
SequenceNode
38+
attributes:
39+
flags = 12
40+
children:
41+
body = [
42+
WriteLocalVariableNode
43+
attributes:
44+
flags = 0
45+
frameSlot = 0
46+
children:
47+
valueNode =
48+
ProfileArgumentNodeGen
49+
attributes:
50+
flags = 0
51+
children:
52+
childNode_ =
53+
ReadSelfNode
54+
attributes:
55+
flags = 0
56+
CheckNoKeywordArgumentsNode
57+
attributes:
58+
flags = 0
59+
children:
60+
readUserKeywordsHashNode =
61+
ReadUserKeywordsHashNode
62+
NilLiteralNode
63+
attributes:
64+
flags = 0
65+
]
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
subject: "Block"
2+
description: "Arity / with rejecting keyword arguments (**nil)"
3+
notes: >
4+
Block parameters are described (as Arity object) in the following way:
5+
- preRequired=0
6+
- optional=0
7+
- hasRest=false
8+
- postRequired=0
9+
- keywordArguments=[]
10+
- requiredKeywordArgumentsCount=0
11+
- hasKeywordsRest=true
12+
13+
So the keyword arguments are reflected in the `hasKeywordsRest=true` attribute.
14+
focused_on_node: "org.truffleruby.language.methods.BlockDefinitionNode"
15+
ruby: |
16+
proc do |**nil|
17+
end
18+
ast: |
19+
BlockDefinitionNodeGen
20+
attributes:
21+
breakID = org.truffleruby.language.control.BreakID@...
22+
callTargets = ProcCallTargets(callTargetForProc = block in <top (required)>, callTargetForLambda = null, altCallTargetCompiler = ...$$Lambda$.../0x...@...)
23+
flags = 0
24+
frameOnStackMarkerSlot = 2
25+
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = true}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = null, type = nokey)])
26+
type = PROC
27+
call targets:
28+
RubyProcRootNode
29+
attributes:
30+
callTarget = block in <top (required)>
31+
frameDescriptor = FrameDescriptor@...{#0:(self)}
32+
instrumentationBits = 0
33+
lock = java.util.concurrent.locks.ReentrantLock@...[Unlocked]
34+
nextProfile = false
35+
polyglotRef = org.truffleruby.RubyLanguage@...
36+
redoProfile = false
37+
retryProfile = false
38+
returnID = org.truffleruby.language.control.ReturnID@...
39+
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = true}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = null, type = nokey)])
40+
split = HEURISTIC
41+
children:
42+
body =
43+
SequenceNode
44+
attributes:
45+
flags = 12
46+
children:
47+
body = [
48+
WriteLocalVariableNode
49+
attributes:
50+
flags = 0
51+
frameSlot = 0
52+
children:
53+
valueNode =
54+
ProfileArgumentNodeGen
55+
attributes:
56+
flags = 0
57+
children:
58+
childNode_ =
59+
ReadSelfNode
60+
attributes:
61+
flags = 0
62+
CheckNoKeywordArgumentsNode
63+
attributes:
64+
flags = 0
65+
children:
66+
readUserKeywordsHashNode =
67+
ReadUserKeywordsHashNode
68+
NilLiteralNode
69+
attributes:
70+
flags = 0
71+
]

spec/truffle/parsing/fixtures/block/destructuring_array_argument/destructure/when_no_rest_positional_parameter_but_multiple_optional_ones.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
subject: "Block"
2-
description: "Destructuring array argument / when no rest positional parameter but optional parameters count > 1 - it tries to destruct"
2+
description: "Destructuring single array argument / when no rest positional parameter but optional parameters count > 1 - it tries to destruct"
33
notes: >
44
A simplified AST for array argument destructuring:
55

spec/truffle/parsing/fixtures/block/destructuring_array_argument/destructure/when_no_rest_positional_parameter_but_multiple_required_ones.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
subject: "Block"
2-
description: "Destructuring array argument / when no rest positional parameter but required parameters count > 1 - it tries to destruct"
2+
description: "Destructuring single array argument / when no rest positional parameter but required parameters count > 1 - it tries to destruct"
33
notes: >
44
A simplified AST for array argument destructuring:
55

spec/truffle/parsing/fixtures/block/destructuring_array_argument/destructure/when_no_rest_positional_parameter_but_single_required_and_single_optional_one.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
subject: "Block"
2-
description: "Destructuring array argument / when no rest positional parameter but one required parameter and one optional one - it tries to destruct"
2+
description: "Destructuring single array argument / when no rest positional parameter but one required parameter and one optional one - it tries to destruct"
33
notes: >
44
A simplified AST for array argument destructuring:
55

spec/truffle/parsing/fixtures/block/destructuring_array_argument/destructure/when_rest_positional_parameter_and_multiple_required_post_ones.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
subject: "Block"
2-
description: "Destructuring array argument / when rest positional parameter and multiple required terminating ones - it tries to destruct"
2+
description: "Destructuring single array argument / when rest positional parameter and multiple required terminating ones - it tries to destruct"
33
notes: >
44
A simplified AST for array argument destructuring:
55

spec/truffle/parsing/fixtures/block/destructuring_array_argument/destructure/when_rest_positional_parameter_and_multiple_required_pre_ones.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
subject: "Block"
2-
description: "Destructuring array argument / when rest positional parameter and multiple required leading ones - it tries to destruct"
2+
description: "Destructuring single array argument / when rest positional parameter and multiple required leading ones - it tries to destruct"
33
notes: >
44
A simplified AST for array argument destructuring:
55

spec/truffle/parsing/fixtures/block/destructuring_array_argument/do_not_destructure/when_no_positional_parameters.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
subject: "Block"
2-
description: "Destructuring array argument / when no positional parameters (required/optional/rest) - it doesn't try to destruct"
2+
description: "Destructuring single array argument / when no positional parameters (required/optional/rest) - it doesn't try to destruct"
33
focused_on_node: "org.truffleruby.language.methods.BlockDefinitionNode"
44
ruby: |
55
proc do

spec/truffle/parsing/fixtures/block/destructuring_array_argument/do_not_destructure/when_one_optional_positional_parameter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
subject: "Block"
2-
description: "Destructuring array argument / when one optional positional parameter - it doesn't try to destruct"
2+
description: "Destructuring single array argument / when one optional positional parameter - it doesn't try to destruct"
33
focused_on_node: "org.truffleruby.language.methods.BlockDefinitionNode"
44
ruby: |
55
proc do |foo = 42|

spec/truffle/parsing/fixtures/block/destructuring_array_argument/do_not_destructure/when_one_required_positional_parameter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
subject: "Block"
2-
description: "Destructuring array argument / when one required positional parameter - it doesn't try to destruct"
2+
description: "Destructuring single array argument / when one required positional parameter - it doesn't try to destruct"
33
focused_on_node: "org.truffleruby.language.methods.BlockDefinitionNode"
44
ruby: |
55
proc do |foo|

0 commit comments

Comments
 (0)