Skip to content

Commit c504fd4

Browse files
committed
Add YAML files
1 parent 9a9a3c8 commit c504fd4

File tree

115 files changed

+3362
-88
lines changed

Some content is hidden

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

115 files changed

+3362
-88
lines changed

spec/truffle/parsing/fixtures/break/with_argument.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ast: |
99
BreakNode
1010
attributes:
1111
breakID = org.truffleruby.language.control.BreakID@...
12-
flags = 1
12+
flags = 0
1313
ignoreMarker = true
1414
children:
1515
child =
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
subject: "Break"
2+
description: "break operator with multiple arguments"
3+
focused_on_node: "org.truffleruby.language.control.BreakNode"
4+
ruby: |
5+
while true
6+
break 42, 100500
7+
end
8+
ast: |
9+
BreakNode
10+
attributes:
11+
breakID = org.truffleruby.language.control.BreakID@...
12+
flags = 0
13+
ignoreMarker = true
14+
children:
15+
child =
16+
ArrayLiteralNode$UninitialisedArrayLiteralNode
17+
attributes:
18+
flags = 0
19+
language = org.truffleruby.RubyLanguage@...
20+
children:
21+
values = [
22+
IntegerFixnumLiteralNode
23+
attributes:
24+
flags = 0
25+
value = 42
26+
IntegerFixnumLiteralNode
27+
attributes:
28+
flags = 0
29+
value = 100500
30+
]

spec/truffle/parsing/fixtures/break/with_splat_operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ast: |
99
BreakNode
1010
attributes:
1111
breakID = org.truffleruby.language.control.BreakID@...
12-
flags = 1
12+
flags = 0
1313
ignoreMarker = true
1414
children:
1515
child =

spec/truffle/parsing/fixtures/break/without_argument.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ast: |
1111
BreakNode
1212
attributes:
1313
breakID = org.truffleruby.language.control.BreakID@...
14-
flags = 1
14+
flags = 0
1515
ignoreMarker = true
1616
children:
1717
child =
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
subject: "class"
2+
description: "class definition with explicit lexical parent module (class ::Foo)"
3+
notes: >
4+
Fully qualified name is represented by a DefineClassNode node:
5+
6+
(DefineClassNode name = "Foo"
7+
(ObjectClassLiteralNode))
8+
focused_on_node: "org.truffleruby.language.objects.RunModuleDefinitionNode"
9+
ruby: |
10+
class ::Foo
11+
end
12+
ast: |
13+
RunModuleDefinitionNode
14+
attributes:
15+
flags = 1
16+
moduleBodyDefinition = ModuleBodyDefinition(name = <class:Foo>, sharedMethodInfo = SharedMethodInfo(sourceSection = SourceSection(source=<parse_ast> [1 - 2], index=0, length=15, characters=class ::Foo\nend), staticLexicalScope = :: null :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = <class:Foo>, blockDepth = 0, parseName = <class:Foo>, notes = null, argumentDescriptors = null), callTarget = <class:Foo>, staticLexicalScope = :: null :: Object, dynamicLexicalScopes = null)
17+
children:
18+
callModuleDefinitionNode =
19+
DefaultIndirectCallNode
20+
definingModule =
21+
DefineClassNode
22+
attributes:
23+
flags = 0
24+
name = "Foo"
25+
children:
26+
lexicalParentModule =
27+
ObjectClassLiteralNode
28+
attributes:
29+
flags = 0
30+
call targets:
31+
RubyRootNode
32+
attributes:
33+
callTarget = <class:Foo>
34+
frameDescriptor = FrameDescriptor@...{#0:(self), #1:%$~_}
35+
instrumentationBits = 0
36+
lock = java.util.concurrent.locks.ReentrantLock@...[Unlocked]
37+
polyglotRef = org.truffleruby.RubyLanguage@...
38+
returnID = org.truffleruby.language.control.ReturnID@...
39+
sharedMethodInfo = SharedMethodInfo(sourceSection = SourceSection(source=<parse_ast> [1 - 2], index=0, length=15, characters=class ::Foo\nend), staticLexicalScope = :: null :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = <class:Foo>, blockDepth = 0, parseName = <class:Foo>, notes = null, argumentDescriptors = null)
40+
sourceSection = SourceSection(source=<parse_ast> [1 - 2], index=0, length=15, characters=class ::Foo\nend)
41+
split = NEVER
42+
children:
43+
body =
44+
SequenceNode
45+
attributes:
46+
flags = 12
47+
children:
48+
body = [
49+
WriteLocalVariableNode
50+
attributes:
51+
flags = 0
52+
frameSlot = 0
53+
children:
54+
valueNode =
55+
ProfileArgumentNodeGen
56+
attributes:
57+
flags = 0
58+
children:
59+
childNode_ =
60+
ReadSelfNode
61+
attributes:
62+
flags = 0
63+
InsideModuleDefinitionNode
64+
attributes:
65+
flags = 0
66+
children:
67+
body =
68+
NilLiteralNode
69+
attributes:
70+
flags = 0
71+
isImplicit = false
72+
]
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
subject: "class"
2+
description: "class definition with fully qualified constant and explicit lexical parent module (class ::Foo::Bar)"
3+
notes: >
4+
Nesting into an outer lexical scope is represented by a `DefineClassNode.lexicalParentModule` node,
5+
constant `Foo` in our example.
6+
focused_on_node: "org.truffleruby.language.objects.RunModuleDefinitionNode"
7+
ruby: |
8+
class ::Foo::Bar
9+
end
10+
ast: |
11+
RunModuleDefinitionNode
12+
attributes:
13+
flags = 1
14+
moduleBodyDefinition = ModuleBodyDefinition(name = <class:Bar>, sharedMethodInfo = SharedMethodInfo(sourceSection = SourceSection(source=<parse_ast> [1 - 2], index=0, length=20, characters=class ::Foo::Bar\nend), staticLexicalScope = :: null :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = <class:Bar>, blockDepth = 0, parseName = <class:Bar>, notes = null, argumentDescriptors = null), callTarget = <class:Bar>, staticLexicalScope = :: null :: Object, dynamicLexicalScopes = null)
15+
children:
16+
callModuleDefinitionNode =
17+
DefaultIndirectCallNode
18+
definingModule =
19+
DefineClassNode
20+
attributes:
21+
flags = 0
22+
name = "Bar"
23+
children:
24+
lexicalParentModule =
25+
ReadConstantNode
26+
attributes:
27+
flags = 0
28+
name = "Foo"
29+
children:
30+
moduleNode =
31+
ObjectClassLiteralNode
32+
attributes:
33+
flags = 0
34+
call targets:
35+
RubyRootNode
36+
attributes:
37+
callTarget = <class:Bar>
38+
frameDescriptor = FrameDescriptor@...{#0:(self), #1:%$~_}
39+
instrumentationBits = 0
40+
lock = java.util.concurrent.locks.ReentrantLock@...[Unlocked]
41+
polyglotRef = org.truffleruby.RubyLanguage@...
42+
returnID = org.truffleruby.language.control.ReturnID@...
43+
sharedMethodInfo = SharedMethodInfo(sourceSection = SourceSection(source=<parse_ast> [1 - 2], index=0, length=20, characters=class ::Foo::Bar\nend), staticLexicalScope = :: null :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = <class:Bar>, blockDepth = 0, parseName = <class:Bar>, notes = null, argumentDescriptors = null)
44+
sourceSection = SourceSection(source=<parse_ast> [1 - 2], index=0, length=20, characters=class ::Foo::Bar\nend)
45+
split = NEVER
46+
children:
47+
body =
48+
SequenceNode
49+
attributes:
50+
flags = 12
51+
children:
52+
body = [
53+
WriteLocalVariableNode
54+
attributes:
55+
flags = 0
56+
frameSlot = 0
57+
children:
58+
valueNode =
59+
ProfileArgumentNodeGen
60+
attributes:
61+
flags = 0
62+
children:
63+
childNode_ =
64+
ReadSelfNode
65+
attributes:
66+
flags = 0
67+
InsideModuleDefinitionNode
68+
attributes:
69+
flags = 0
70+
children:
71+
body =
72+
NilLiteralNode
73+
attributes:
74+
flags = 0
75+
isImplicit = false
76+
]
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
subject: "class"
2+
description: "class definition with empty body"
3+
notes: >
4+
A class definition is represented as a RunModuleDefinitionNode node,
5+
that is used for both classes and modules definition,
6+
and with specific for a class a child DefineClassNode node.
7+
8+
A class body is represented as a CallTarget, (that will be used to create an internal method),
9+
stored in ModuleBodyDefinition.
10+
11+
Expressions inside a class body are represented by InsideModuleDefinitionNode node.
12+
focused_on_node: "org.truffleruby.language.objects.RunModuleDefinitionNode"
13+
ruby: |
14+
class Foo
15+
end
16+
ast: |
17+
RunModuleDefinitionNode
18+
attributes:
19+
flags = 1
20+
moduleBodyDefinition = ModuleBodyDefinition(name = <class:Foo>, sharedMethodInfo = SharedMethodInfo(sourceSection = SourceSection(source=<parse_ast> [1 - 2], index=0, length=13, characters=class Foo\nend), staticLexicalScope = :: null :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = <class:Foo>, blockDepth = 0, parseName = <class:Foo>, notes = null, argumentDescriptors = null), callTarget = <class:Foo>, staticLexicalScope = :: null :: Object, dynamicLexicalScopes = null)
21+
children:
22+
callModuleDefinitionNode =
23+
DefaultIndirectCallNode
24+
definingModule =
25+
DefineClassNode
26+
attributes:
27+
flags = 0
28+
name = "Foo"
29+
children:
30+
lexicalParentModule =
31+
LexicalScopeNode
32+
attributes:
33+
flags = 0
34+
lexicalScope = :: Object
35+
call targets:
36+
RubyRootNode
37+
attributes:
38+
callTarget = <class:Foo>
39+
frameDescriptor = FrameDescriptor@...{#0:(self), #1:%$~_}
40+
instrumentationBits = 0
41+
lock = java.util.concurrent.locks.ReentrantLock@...[Unlocked]
42+
polyglotRef = org.truffleruby.RubyLanguage@...
43+
returnID = org.truffleruby.language.control.ReturnID@...
44+
sharedMethodInfo = SharedMethodInfo(sourceSection = SourceSection(source=<parse_ast> [1 - 2], index=0, length=13, characters=class Foo\nend), staticLexicalScope = :: null :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = <class:Foo>, blockDepth = 0, parseName = <class:Foo>, notes = null, argumentDescriptors = null)
45+
sourceSection = SourceSection(source=<parse_ast> [1 - 2], index=0, length=13, characters=class Foo\nend)
46+
split = NEVER
47+
children:
48+
body =
49+
SequenceNode
50+
attributes:
51+
flags = 12
52+
children:
53+
body = [
54+
WriteLocalVariableNode
55+
attributes:
56+
flags = 0
57+
frameSlot = 0
58+
children:
59+
valueNode =
60+
ProfileArgumentNodeGen
61+
attributes:
62+
flags = 0
63+
children:
64+
childNode_ =
65+
ReadSelfNode
66+
attributes:
67+
flags = 0
68+
InsideModuleDefinitionNode
69+
attributes:
70+
flags = 0
71+
children:
72+
body =
73+
NilLiteralNode
74+
attributes:
75+
flags = 0
76+
isImplicit = false
77+
]

spec/truffle/parsing/fixtures/classes/class_with_not_empty_body.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ ast: |
7272
body = [
7373
IntegerFixnumLiteralNode
7474
attributes:
75-
flags = 1
75+
flags = 0
7676
value = 1
7777
IntegerFixnumLiteralNode
7878
attributes:
79-
flags = 1
79+
flags = 0
8080
value = 2
8181
]
8282
]

spec/truffle/parsing/fixtures/ensure/in_begin_end_block.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ast: |
4141
descriptor = org.truffleruby.language.arguments.EmptyArgumentsDescriptor@...
4242
dispatchConfig = PRIVATE
4343
emptyKeywordsProfile = false
44-
flags = 1
44+
flags = 0
4545
isAttrAssign = false
4646
isSafeNavigation = false
4747
isSplatted = false
@@ -60,6 +60,6 @@ ast: |
6060
StringLiteralNode
6161
attributes:
6262
encoding = UTF-8
63-
flags = 1
63+
flags = 0
6464
tstring = foo
6565
]

spec/truffle/parsing/fixtures/ensure/in_module.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ast: |
7878
descriptor = org.truffleruby.language.arguments.EmptyArgumentsDescriptor@...
7979
dispatchConfig = PRIVATE
8080
emptyKeywordsProfile = false
81-
flags = 1
81+
flags = 0
8282
isAttrAssign = false
8383
isSafeNavigation = false
8484
isSplatted = false
@@ -97,6 +97,6 @@ ast: |
9797
StringLiteralNode
9898
attributes:
9999
encoding = UTF-8
100-
flags = 1
100+
flags = 0
101101
tstring = foo
102102
]

0 commit comments

Comments
 (0)