myco 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/myco/bootstrap.my.rb +50 -14
- data/lib/myco/bootstrap/add_method.rb +5 -5
- data/lib/myco/bootstrap/meme.rb +2 -1
- data/lib/myco/code_tools/AST.my.rb +211 -43
- data/lib/myco/code_tools/AST/ArgumentAssembly.my.rb +92 -48
- data/lib/myco/code_tools/AST/ArrayAssembly.my.rb +39 -27
- data/lib/myco/code_tools/AST/Block.my.rb +176 -112
- data/lib/myco/code_tools/AST/BlockArgument.my.rb +29 -17
- data/lib/myco/code_tools/AST/BlockLiteral.my.rb +37 -17
- data/lib/myco/code_tools/AST/BlockParameter.my.rb +25 -9
- data/lib/myco/code_tools/AST/BranchOperator.my.rb +95 -75
- data/lib/myco/code_tools/AST/ConstantAccess.my.rb +52 -32
- data/lib/myco/code_tools/AST/ConstantAssignment.my.rb +52 -36
- data/lib/myco/code_tools/AST/ConstantDefine.my.rb +50 -26
- data/lib/myco/code_tools/AST/DeclareCategory.my.rb +38 -18
- data/lib/myco/code_tools/AST/DeclareExtension.my.rb +29 -13
- data/lib/myco/code_tools/AST/DeclareFile.my.rb +51 -31
- data/lib/myco/code_tools/AST/DeclareMeme.my.rb +96 -68
- data/lib/myco/code_tools/AST/DeclareObject.my.rb +66 -42
- data/lib/myco/code_tools/AST/DeclareString.my.rb +39 -19
- data/lib/myco/code_tools/AST/DeclaredScope.my.rb +92 -64
- data/lib/myco/code_tools/AST/Invoke.my +8 -4
- data/lib/myco/code_tools/AST/Invoke.my.rb +74 -31
- data/lib/myco/code_tools/AST/InvokeMethod.my.rb +34 -14
- data/lib/myco/code_tools/AST/KeywordAssembly.my.rb +36 -24
- data/lib/myco/code_tools/AST/KeywordOptionalParameter.my.rb +28 -8
- data/lib/myco/code_tools/AST/KeywordRequiredParameter.my.rb +23 -7
- data/lib/myco/code_tools/AST/KeywordRestParameter.my.rb +23 -7
- data/lib/myco/code_tools/AST/LocalVariableAccessAmbiguous.my.rb +24 -12
- data/lib/myco/code_tools/AST/LocalVariableAssignment.my.rb +30 -10
- data/lib/myco/code_tools/AST/Node.my.rb +234 -102
- data/lib/myco/code_tools/AST/NumericLiteral.my.rb +18 -6
- data/lib/myco/code_tools/AST/OptionalParameter.my.rb +33 -13
- data/lib/myco/code_tools/AST/ParameterAssembly.my.rb +275 -211
- data/lib/myco/code_tools/AST/PipeOperator.my.rb +42 -18
- data/lib/myco/code_tools/AST/Quest.my.rb +65 -37
- data/lib/myco/code_tools/AST/RequiredParameter.my.rb +20 -4
- data/lib/myco/code_tools/AST/RestParameter.my.rb +20 -4
- data/lib/myco/code_tools/AST/Script.my.rb +51 -23
- data/lib/myco/code_tools/AST/Sequence.my.rb +22 -10
- data/lib/myco/code_tools/AST/SplatValue.my.rb +28 -16
- data/lib/myco/code_tools/AST/StringCompose.my.rb +23 -11
- data/lib/myco/code_tools/AST/StringLiteral.my.rb +19 -7
- data/lib/myco/code_tools/AST/SymbolCompose.my.rb +27 -15
- data/lib/myco/code_tools/AST/SymbolLiteral.my.rb +18 -6
- data/lib/myco/code_tools/AST/ToRuby.my.rb +581 -341
- data/lib/myco/code_tools/AST/misc.my.rb +87 -35
- data/lib/myco/code_tools/Parser.my.rb +39 -12
- data/lib/myco/code_tools/parser/MycoBuilder.my.rb +106 -90
- data/lib/myco/code_tools/parser/MycoCharacterClasses.my.rb +98 -50
- data/lib/myco/code_tools/parser/MycoGrammar.my +1 -6
- data/lib/myco/code_tools/parser/MycoGrammar.my.rb +2124 -1710
- data/lib/myco/code_tools/parser/MycoTokens.my +0 -5
- data/lib/myco/code_tools/parser/MycoTokens.my.rb +387 -156
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces.my.rb +55 -11
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/BytecodeHelpers.my.rb +321 -205
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Capture.my.rb +223 -127
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Common.my.rb +188 -72
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Common/Parser.my +48 -0
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Common/Parser.my.rb +365 -189
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Composite.my.rb +313 -233
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Grammar.my.rb +99 -55
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Processor.my.rb +493 -325
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Stream.my.rb +138 -114
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Stream/Parser.my.rb +56 -44
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/String.my.rb +173 -93
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/String/Parser.my.rb +90 -70
- data/lib/myco/command.my.rb +85 -25
- data/lib/myco/command/inoculate.my.rb +219 -127
- data/lib/myco/core.my.rb +20 -4
- data/lib/myco/core/BasicDecorators.my.rb +211 -119
- data/lib/myco/core/BasicObject.my.rb +108 -44
- data/lib/myco/core/Category.my.rb +37 -13
- data/lib/myco/core/Decorator.my.rb +35 -27
- data/lib/myco/core/FileToplevel.my.rb +55 -27
- data/lib/myco/core/Loop.my.rb +16 -8
- data/lib/myco/core/Object.my.rb +34 -14
- data/lib/myco/core/Ruby.my.rb +13 -5
- data/lib/myco/core/Switch.my.rb +79 -47
- data/lib/myco/tools/BasicCommand.my.rb +79 -47
- data/lib/myco/tools/mycompile.my.rb +153 -69
- data/lib/myco/version.rb +1 -1
- metadata +34 -52
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Parser.my +0 -144
- data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Parser.my.rb +0 -221
- data/lib/myco/code_tools/parser/pegleromyces/spec/BasicSpec.my +0 -35
- data/lib/myco/code_tools/parser/pegleromyces/spec/BasicSpec.my.rb +0 -35
- data/lib/myco/code_tools/parser/pegleromyces/spec/Grammar.test.my +0 -10
- data/lib/myco/code_tools/parser/pegleromyces/spec/Grammar.test.my.rb +0 -9
- data/lib/myco/code_tools/parser/pegleromyces/spec/Patterns.test.my +0 -162
- data/lib/myco/code_tools/parser/pegleromyces/spec/Patterns.test.my.rb +0 -353
- data/lib/myco/code_tools/parser/pegleromyces/spec/Processor.test.my +0 -10
- data/lib/myco/code_tools/parser/pegleromyces/spec/Processor.test.my.rb +0 -9
- data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Parser.test.my +0 -49
- data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Parser.test.my.rb +0 -119
- data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Patterns.test.my +0 -131
- data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Patterns.test.my.rb +0 -595
- data/lib/myco/code_tools/parser/pegleromyces/spec/String/Parser.test.my +0 -120
- data/lib/myco/code_tools/parser/pegleromyces/spec/String/Parser.test.my.rb +0 -350
- data/lib/myco/code_tools/parser/pegleromyces/spec/run.my +0 -14
- data/lib/myco/code_tools/parser/pegleromyces/spec/run.my.rb +0 -12
@@ -2,33 +2,45 @@
|
|
2
2
|
::Myco::Component.new([::Myco::FileToplevel], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
3
3
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(::Myco.find_constant(:CodeTools)::AST.component_eval {(::Myco.cscope.for_method_definition::ArrayAssembly = ::Myco::Component.new([::Myco.find_constant(:Node)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
4
4
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
5
|
-
declare_meme(
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
5
|
+
declare_meme(
|
6
|
+
:array,
|
7
|
+
[:node_type],
|
8
|
+
::Object::Proc.new { |*| nil}
|
9
|
+
)
|
10
|
+
declare_meme(
|
11
|
+
:body,
|
12
|
+
[:field],
|
13
|
+
::Object::Proc.new { |*| nil}
|
14
|
+
)
|
15
|
+
declare_meme(
|
16
|
+
:bytecode,
|
17
|
+
[],
|
18
|
+
::Object::Proc.new { |g| (
|
19
|
+
self.pos(g)
|
20
|
+
::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.body.__send__(:empty?)) {g.make_array(0)}) {(
|
21
|
+
chunked = self.body.chunk { |item| (item.__send__(
|
22
|
+
:is_a?,
|
23
|
+
::Myco.find_constant(:SplatValue)
|
24
|
+
))}
|
25
|
+
first_bytecode = true
|
26
|
+
chunked.each { |is_splat_group, group| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", is_splat_group) {group.each { |item| (
|
27
|
+
item.bytecode(g)
|
28
|
+
::Myco.branch_op(:"||", first_bytecode) {g.send(
|
29
|
+
:concat,
|
30
|
+
1
|
31
|
+
)}
|
32
|
+
first_bytecode = false
|
33
|
+
)}}) {(
|
34
|
+
group.each { |item| (item.bytecode(g))}
|
35
|
+
g.make_array(group.size)
|
36
|
+
::Myco.branch_op(:"||", first_bytecode) {g.send(
|
37
|
+
:concat,
|
38
|
+
1
|
39
|
+
)}
|
40
|
+
first_bytecode = false
|
41
|
+
)})}
|
42
|
+
)}
|
31
43
|
)}
|
32
|
-
)
|
44
|
+
)
|
33
45
|
)}}
|
34
46
|
.tap { |__c__| __c__.__name__ = :ArrayAssembly })})}}.instance
|
@@ -5,51 +5,73 @@
|
|
5
5
|
::Myco.find_constant(:Node)
|
6
6
|
], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
7
7
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
8
|
-
declare_meme(
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
declare_meme(
|
9
|
+
:block,
|
10
|
+
[:node_type],
|
11
|
+
::Object::Proc.new { |*| nil}
|
12
|
+
)
|
13
|
+
declare_meme(
|
14
|
+
:parameters,
|
15
|
+
[:field],
|
16
|
+
::Object::Proc.new { |*| nil}
|
17
|
+
)
|
18
|
+
declare_meme(
|
19
|
+
:body,
|
20
|
+
[:field],
|
21
|
+
::Object::Proc.new { |*| nil}
|
22
|
+
)
|
23
|
+
declare_meme(
|
24
|
+
:parent,
|
25
|
+
[:var],
|
26
|
+
::Object::Proc.new { |*| nil}
|
27
|
+
)
|
28
|
+
declare_meme(
|
29
|
+
:new_cscope,
|
30
|
+
[:var],
|
31
|
+
::Object::Proc.new { |*| nil}
|
32
|
+
)
|
13
33
|
::Myco.cscope.for_method_definition::CompilerClass = (::Myco.find_constant(:CodeTools)::Compiler)
|
14
|
-
declare_meme(
|
15
|
-
|
16
|
-
|
17
|
-
:
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
:
|
23
|
-
|
24
|
-
|
25
|
-
declare_meme(:search_local, [], nil, ::Myco.cscope.dup) { |name| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", variable = self.variables.__send__(
|
26
|
-
:[],
|
27
|
-
name
|
28
|
-
)) {variable.nested_reference}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.__send__(
|
34
|
+
declare_meme(
|
35
|
+
:body,
|
36
|
+
[:setter],
|
37
|
+
::Object::Proc.new { |given| (::Myco.branch_op(:"||", given) {::Myco.find_constant(:NullLiteral).new({:line => self.line})})}
|
38
|
+
)
|
39
|
+
declare_meme(
|
40
|
+
:locals,
|
41
|
+
[],
|
42
|
+
::Object::Proc.new { |*| (::Myco.branch_op(:"??", (Rubinius::Type.object_respond_to?((Rubinius::Type.object_respond_to?(self.body, :locals).false? ? ::Myco::Void : self.body.locals), :body).false? ? ::Myco::Void : (Rubinius::Type.object_respond_to?(self.body, :locals).false? ? ::Myco::Void : self.body.locals).body).map(&:value)) {nil})}
|
43
|
+
)
|
44
|
+
declare_meme(
|
29
45
|
:block_local?,
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
)
|
41
|
-
declare_meme(
|
42
|
-
:
|
43
|
-
|
46
|
+
[],
|
47
|
+
::Object::Proc.new { |name| (::Myco.branch_op(:"??", (Rubinius::Type.object_respond_to?(self.locals, :include?).false? ? ::Myco::Void : self.locals.__send__(
|
48
|
+
:include?,
|
49
|
+
name
|
50
|
+
))) {false})}
|
51
|
+
)
|
52
|
+
declare_meme(
|
53
|
+
:module?,
|
54
|
+
[],
|
55
|
+
::Object::Proc.new { |*| (false)}
|
56
|
+
)
|
57
|
+
declare_meme(
|
58
|
+
:nest_scope,
|
59
|
+
[],
|
60
|
+
::Object::Proc.new { |scope| (scope.__send__(
|
61
|
+
:parent=,
|
62
|
+
self
|
63
|
+
))}
|
64
|
+
)
|
65
|
+
declare_meme(
|
66
|
+
:search_local,
|
67
|
+
[],
|
68
|
+
::Object::Proc.new { |name| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", variable = self.variables.__send__(
|
44
69
|
:[],
|
45
|
-
|
46
|
-
)) {variable.
|
70
|
+
name
|
71
|
+
)) {variable.nested_reference}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.__send__(
|
47
72
|
:block_local?,
|
48
|
-
|
49
|
-
)) {(
|
50
|
-
variable = self.new_local(var.name)
|
51
|
-
variable.reference
|
52
|
-
)}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", reference = self.parent.search_local(var.name)) {(
|
73
|
+
name
|
74
|
+
)) {self.new_local(name)}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", reference = self.parent.search_local(name)) {(
|
53
75
|
reference.__send__(
|
54
76
|
:depth=,
|
55
77
|
reference.depth.__send__(
|
@@ -58,78 +80,120 @@
|
|
58
80
|
)
|
59
81
|
)
|
60
82
|
reference
|
61
|
-
)}) {
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
:
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
0
|
83
|
+
)}) {nil}}})}
|
84
|
+
)
|
85
|
+
declare_meme(
|
86
|
+
:assign_local_reference,
|
87
|
+
[],
|
88
|
+
::Object::Proc.new { |var| (var.__send__(
|
89
|
+
:variable=,
|
90
|
+
::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", variable = self.variables.__send__(
|
91
|
+
:[],
|
92
|
+
var.name
|
93
|
+
)) {variable.reference}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.__send__(
|
94
|
+
:block_local?,
|
95
|
+
var.name
|
96
|
+
)) {(
|
97
|
+
variable = self.new_local(var.name)
|
98
|
+
variable.reference
|
99
|
+
)}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", reference = self.parent.search_local(var.name)) {(
|
100
|
+
reference.__send__(
|
101
|
+
:depth=,
|
102
|
+
reference.depth.__send__(
|
103
|
+
:+,
|
104
|
+
1
|
105
|
+
)
|
106
|
+
)
|
107
|
+
reference
|
108
|
+
)}) {(
|
109
|
+
variable = self.new_local(var.name)
|
110
|
+
variable.reference
|
111
|
+
)}}}
|
112
|
+
))}
|
113
|
+
)
|
114
|
+
declare_meme(
|
115
|
+
:new_local,
|
116
|
+
[],
|
117
|
+
::Object::Proc.new { |name| (self.variables.__send__(
|
118
|
+
:[]=,
|
119
|
+
name,
|
120
|
+
::Myco.branch_op(:"||", self.variables.__send__(
|
121
|
+
:[],
|
122
|
+
name
|
123
|
+
)) {::Myco.find_constant(:CompilerClass)::LocalVariable.new(self.allocate_slot)}
|
124
|
+
))}
|
125
|
+
)
|
126
|
+
declare_meme(
|
127
|
+
:new_nested_local,
|
128
|
+
[],
|
129
|
+
::Object::Proc.new { |name| (self.new_local(name).nested_reference)}
|
130
|
+
)
|
131
|
+
declare_meme(
|
132
|
+
:effective_parameters,
|
133
|
+
[],
|
134
|
+
::Object::Proc.new { |*| (::Myco.branch_op(:"||", self.parameters) {::Myco.find_constant(:ParameterAssembly).new({
|
135
|
+
:line => self.line,
|
136
|
+
:rest => ::Myco.find_constant(:RestParameter).new({:line => self.line})
|
137
|
+
})})}
|
138
|
+
)
|
139
|
+
declare_meme(
|
140
|
+
:bytecode,
|
141
|
+
[],
|
142
|
+
::Object::Proc.new { |g| (
|
143
|
+
self.pos(g)
|
144
|
+
state = g.state
|
145
|
+
state.scope.nest_scope(self)
|
146
|
+
parameters = self.effective_parameters
|
147
|
+
blk = self.new_block_generator(
|
148
|
+
g,
|
149
|
+
parameters
|
129
150
|
)
|
130
|
-
|
151
|
+
blk.push_state(self)
|
152
|
+
blk.definition_line(self.line)
|
153
|
+
blk.state.push_super(state.super)
|
154
|
+
blk.state.push_eval(state.eval)
|
155
|
+
blk.state.push_name(blk.name)
|
156
|
+
self.pos(blk)
|
157
|
+
parameters.bytecode(blk)
|
158
|
+
blk.state.push_block
|
159
|
+
blk.push_modifiers
|
160
|
+
blk.__send__(
|
161
|
+
:break=,
|
162
|
+
nil
|
163
|
+
)
|
164
|
+
blk.__send__(
|
165
|
+
:next=,
|
166
|
+
nil
|
167
|
+
)
|
168
|
+
blk.__send__(
|
169
|
+
:redo=,
|
170
|
+
blk.new_label
|
171
|
+
)
|
172
|
+
blk.redo.__send__(:set!)
|
173
|
+
self.body.bytecode(blk)
|
174
|
+
blk.pop_modifiers
|
175
|
+
blk.state.pop_block
|
176
|
+
blk.ret
|
177
|
+
blk.close
|
178
|
+
blk.pop_state
|
179
|
+
blk.__send__(
|
180
|
+
:local_count=,
|
181
|
+
self.local_count
|
182
|
+
)
|
183
|
+
blk.__send__(
|
184
|
+
:local_names=,
|
185
|
+
self.local_names
|
186
|
+
)
|
187
|
+
::Myco.branch_op(:"&?", self.new_cscope) {(
|
188
|
+
g.push_scope
|
189
|
+
g.send(
|
190
|
+
:for_method_definition,
|
191
|
+
0
|
192
|
+
)
|
193
|
+
g.add_scope
|
194
|
+
)}
|
195
|
+
g.create_block(blk)
|
131
196
|
)}
|
132
|
-
|
133
|
-
)}
|
197
|
+
)
|
134
198
|
)}}
|
135
199
|
.tap { |__c__| __c__.__name__ = :Block })})}}.instance
|
@@ -2,22 +2,34 @@
|
|
2
2
|
::Myco::Component.new([::Myco::FileToplevel], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
3
3
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(::Myco.find_constant(:CodeTools)::AST.component_eval {(::Myco.cscope.for_method_definition::BlockArgument = ::Myco::Component.new([::Myco.find_constant(:Node)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
4
4
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
5
|
-
declare_meme(
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
5
|
+
declare_meme(
|
6
|
+
:blkarg,
|
7
|
+
[:node_type],
|
8
|
+
::Object::Proc.new { |*| nil}
|
9
|
+
)
|
10
|
+
declare_meme(
|
11
|
+
:body,
|
12
|
+
[:field],
|
13
|
+
::Object::Proc.new { |*| nil}
|
14
|
+
)
|
15
|
+
declare_meme(
|
16
|
+
:bytecode,
|
17
|
+
[],
|
18
|
+
::Object::Proc.new { |g| (
|
19
|
+
self.body.bytecode(g)
|
20
|
+
done_label = g.new_label
|
21
|
+
g.dup
|
22
|
+
g.is_nil
|
23
|
+
g.goto_if_true(done_label)
|
24
|
+
g.push_cpath_top
|
25
|
+
g.find_const(:Proc)
|
26
|
+
g.swap
|
27
|
+
g.send(
|
28
|
+
:__from_block__,
|
29
|
+
1
|
30
|
+
)
|
31
|
+
done_label.__send__(:set!)
|
32
|
+
)}
|
33
|
+
)
|
22
34
|
)}}
|
23
35
|
.tap { |__c__| __c__.__name__ = :BlockArgument })})}}.instance
|
@@ -2,22 +2,42 @@
|
|
2
2
|
::Myco::Component.new([::Myco::FileToplevel], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
3
3
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(::Myco.find_constant(:CodeTools)::AST.component_eval {(::Myco.cscope.for_method_definition::BlockLiteral = ::Myco::Component.new([::Myco.find_constant(:Node)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
4
4
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
5
|
-
declare_meme(
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
declare_meme(
|
16
|
-
:
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
5
|
+
declare_meme(
|
6
|
+
:blklit,
|
7
|
+
[:node_type],
|
8
|
+
::Object::Proc.new { |*| nil}
|
9
|
+
)
|
10
|
+
declare_meme(
|
11
|
+
:block,
|
12
|
+
[:field],
|
13
|
+
::Object::Proc.new { |*| nil}
|
14
|
+
)
|
15
|
+
declare_meme(
|
16
|
+
:implementation_receiver,
|
17
|
+
[],
|
18
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:ConstantAccess).new({
|
19
|
+
:line => self.line,
|
20
|
+
:toplevel => true,
|
21
|
+
:names => [
|
22
|
+
:Ruby,
|
23
|
+
:Proc
|
24
|
+
]
|
25
|
+
}))}
|
26
|
+
)
|
27
|
+
declare_meme(
|
28
|
+
:implementation,
|
29
|
+
[],
|
30
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:Invoke).new({
|
31
|
+
:line => self.line,
|
32
|
+
:receiver => self.implementation_receiver,
|
33
|
+
:name => :new,
|
34
|
+
:block => self.block
|
35
|
+
}))}
|
36
|
+
)
|
37
|
+
declare_meme(
|
38
|
+
:bytecode,
|
39
|
+
[],
|
40
|
+
::Object::Proc.new { |g| (self.implementation.bytecode(g))}
|
41
|
+
)
|
22
42
|
)}}
|
23
43
|
.tap { |__c__| __c__.__name__ = :BlockLiteral })})}}.instance
|