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
@@ -11,25 +11,53 @@
|
|
11
11
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
12
12
|
.tap { |__c__| __c__.__name__ = :BinaryBase }
|
13
13
|
::Myco.cscope.for_method_definition::NegativePredicate = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
14
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
14
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
15
|
+
:construct_type,
|
16
|
+
[],
|
17
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::NegativePredicate)}
|
18
|
+
))}}
|
15
19
|
.tap { |__c__| __c__.__name__ = :NegativePredicate }
|
16
20
|
::Myco.cscope.for_method_definition::PositivePredicate = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
17
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
21
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
22
|
+
:construct_type,
|
23
|
+
[],
|
24
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::PositivePredicate)}
|
25
|
+
))}}
|
18
26
|
.tap { |__c__| __c__.__name__ = :PositivePredicate }
|
19
27
|
::Myco.cscope.for_method_definition::OneOrMore = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
20
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
28
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
29
|
+
:construct_type,
|
30
|
+
[],
|
31
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::OneOrMore)}
|
32
|
+
))}}
|
21
33
|
.tap { |__c__| __c__.__name__ = :OneOrMore }
|
22
34
|
::Myco.cscope.for_method_definition::ZeroOrOne = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
23
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
35
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
36
|
+
:construct_type,
|
37
|
+
[],
|
38
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::ZeroOrOne)}
|
39
|
+
))}}
|
24
40
|
.tap { |__c__| __c__.__name__ = :ZeroOrOne }
|
25
41
|
::Myco.cscope.for_method_definition::ZeroOrMore = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
26
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
42
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
43
|
+
:construct_type,
|
44
|
+
[],
|
45
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::ZeroOrMore)}
|
46
|
+
))}}
|
27
47
|
.tap { |__c__| __c__.__name__ = :ZeroOrMore }
|
28
48
|
::Myco.cscope.for_method_definition::OrderedChoice = ::Myco::Component.new([::Myco.find_constant(:BinaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
29
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
49
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
50
|
+
:construct_type,
|
51
|
+
[],
|
52
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::OrderedChoice)}
|
53
|
+
))}}
|
30
54
|
.tap { |__c__| __c__.__name__ = :OrderedChoice }
|
31
55
|
::Myco.cscope.for_method_definition::Concatenation = ::Myco::Component.new([::Myco.find_constant(:BinaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
32
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
56
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
57
|
+
:construct_type,
|
58
|
+
[],
|
59
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::Concatenation)}
|
60
|
+
))}}
|
33
61
|
.tap { |__c__| __c__.__name__ = :Concatenation }
|
34
62
|
)}}
|
35
63
|
.tap { |__c__| __c__.__name__ = :Patterns }
|
@@ -48,13 +76,21 @@
|
|
48
76
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
49
77
|
.tap { |__c__| __c__.__name__ = :PositivePredicate }
|
50
78
|
::Myco.cscope.for_method_definition::OneOrMore = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
51
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
79
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
80
|
+
:inlaid,
|
81
|
+
[:var],
|
82
|
+
::Object::Proc.new { |*| nil}
|
83
|
+
))}}
|
52
84
|
.tap { |__c__| __c__.__name__ = :OneOrMore }
|
53
85
|
::Myco.cscope.for_method_definition::ZeroOrOne = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
54
86
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
55
87
|
.tap { |__c__| __c__.__name__ = :ZeroOrOne }
|
56
88
|
::Myco.cscope.for_method_definition::ZeroOrMore = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
57
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
89
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
90
|
+
:inlaid,
|
91
|
+
[:var],
|
92
|
+
::Object::Proc.new { |*| nil}
|
93
|
+
))}}
|
58
94
|
.tap { |__c__| __c__.__name__ = :ZeroOrMore }
|
59
95
|
::Myco.cscope.for_method_definition::OrderedChoice = ::Myco::Component.new([::Myco.find_constant(:BinaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
60
96
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
|
@@ -65,232 +101,276 @@
|
|
65
101
|
)}}
|
66
102
|
.tap { |__c__| __c__.__name__ = :Constructions }
|
67
103
|
::Myco.find_constant(:Patterns).component_eval {(
|
68
|
-
::Myco.find_constant(:NegativePredicate).component_eval {(declare_meme(
|
69
|
-
|
70
|
-
|
71
|
-
self
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
self
|
77
|
-
|
78
|
-
|
79
|
-
|
104
|
+
::Myco.find_constant(:NegativePredicate).component_eval {(declare_meme(
|
105
|
+
:!,
|
106
|
+
[],
|
107
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:PositivePredicate).new({:inner => self.inner}))}
|
108
|
+
))}
|
109
|
+
::Myco.find_constant(:PositivePredicate).component_eval {(declare_meme(
|
110
|
+
:!,
|
111
|
+
[],
|
112
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:NegativePredicate).new({:inner => self.inner}))}
|
113
|
+
))}
|
114
|
+
::Myco.find_constant(:OrderedChoice).component_eval {(declare_meme(
|
115
|
+
:/,
|
116
|
+
[],
|
117
|
+
::Object::Proc.new { |other| (self.private.binary_right_assoc(
|
118
|
+
self,
|
119
|
+
other,
|
120
|
+
::Myco.find_constant(:OrderedChoice)
|
121
|
+
))}
|
122
|
+
))}
|
123
|
+
::Myco.find_constant(:Concatenation).component_eval {(declare_meme(
|
124
|
+
:+,
|
125
|
+
[],
|
126
|
+
::Object::Proc.new { |other=false| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", other) {self.private.binary_right_assoc(
|
127
|
+
self,
|
128
|
+
other,
|
129
|
+
::Myco.find_constant(:Concatenation)
|
130
|
+
)}) {::Myco.find_constant(:OneOrMore).new({:inner => self})})}
|
131
|
+
))}
|
80
132
|
)}
|
81
133
|
::Myco.find_constant(:Constructions).component_eval {(
|
82
|
-
::Myco.find_constant(:NegativePredicate).component_eval {(declare_meme(
|
83
|
-
|
84
|
-
|
85
|
-
g
|
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
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
:
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
:
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
self.
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
self.inner.
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
g
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
:
|
263
|
-
self.
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
)
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
g
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
134
|
+
::Myco.find_constant(:NegativePredicate).component_eval {(declare_meme(
|
135
|
+
:bytecode,
|
136
|
+
[],
|
137
|
+
::Object::Proc.new { |g| (
|
138
|
+
local_fail = g.new_label
|
139
|
+
old_fail = g.overall_fail
|
140
|
+
g.__send__(
|
141
|
+
:overall_fail=,
|
142
|
+
local_fail
|
143
|
+
)
|
144
|
+
self.__send__(
|
145
|
+
:if,
|
146
|
+
self.inner.__send__(:bytecode_can_capture?)
|
147
|
+
) { |*| (g.push_temp_captures)}
|
148
|
+
g.push_idx
|
149
|
+
self.inner.bytecode(g)
|
150
|
+
g.pop_to_set_idx
|
151
|
+
self.__send__(
|
152
|
+
:if,
|
153
|
+
self.inner.__send__(:bytecode_can_capture?)
|
154
|
+
) { |*| (g.pop_to_reject_captures)}
|
155
|
+
g.__send__(
|
156
|
+
:overall_fail=,
|
157
|
+
old_fail
|
158
|
+
)
|
159
|
+
g.goto(g.overall_fail)
|
160
|
+
local_fail.__send__(:set!)
|
161
|
+
g.pop_to_set_idx
|
162
|
+
self.__send__(
|
163
|
+
:if,
|
164
|
+
self.inner.__send__(:bytecode_can_capture?)
|
165
|
+
) { |*| (g.pop_to_reject_captures)}
|
166
|
+
g.__send__(
|
167
|
+
:overall_fail=,
|
168
|
+
old_fail
|
169
|
+
)
|
170
|
+
)}
|
171
|
+
))}
|
172
|
+
::Myco.find_constant(:PositivePredicate).component_eval {(declare_meme(
|
173
|
+
:bytecode,
|
174
|
+
[],
|
175
|
+
::Object::Proc.new { |g| (
|
176
|
+
local_done = g.new_label
|
177
|
+
local_fail = g.new_label
|
178
|
+
old_fail = g.overall_fail
|
179
|
+
g.__send__(
|
180
|
+
:overall_fail=,
|
181
|
+
local_fail
|
182
|
+
)
|
183
|
+
self.__send__(
|
184
|
+
:if,
|
185
|
+
self.inner.__send__(:bytecode_can_capture?)
|
186
|
+
) { |*| (g.push_temp_captures)}
|
187
|
+
g.push_idx
|
188
|
+
self.inner.bytecode(g)
|
189
|
+
g.pop_to_set_idx
|
190
|
+
self.__send__(
|
191
|
+
:if,
|
192
|
+
self.inner.__send__(:bytecode_can_capture?)
|
193
|
+
) { |*| (g.pop_to_accept_captures)}
|
194
|
+
g.__send__(
|
195
|
+
:overall_fail=,
|
196
|
+
old_fail
|
197
|
+
)
|
198
|
+
g.goto(local_done)
|
199
|
+
local_fail.__send__(:set!)
|
200
|
+
g.pop_to_set_idx
|
201
|
+
self.__send__(
|
202
|
+
:if,
|
203
|
+
self.inner.__send__(:bytecode_can_capture?)
|
204
|
+
) { |*| (g.pop_to_reject_captures)}
|
205
|
+
g.__send__(
|
206
|
+
:overall_fail=,
|
207
|
+
old_fail
|
208
|
+
)
|
209
|
+
g.goto(g.overall_fail)
|
210
|
+
local_done.__send__(:set!)
|
211
|
+
)}
|
212
|
+
))}
|
213
|
+
::Myco.find_constant(:OneOrMore).component_eval {(declare_meme(
|
214
|
+
:bytecode,
|
215
|
+
[],
|
216
|
+
::Object::Proc.new { |g| (
|
217
|
+
local_retry = g.new_label
|
218
|
+
local_fail = g.new_label
|
219
|
+
old_fail = g.overall_fail
|
220
|
+
g.__send__(
|
221
|
+
:overall_fail=,
|
222
|
+
local_fail
|
223
|
+
)
|
224
|
+
g.push_false
|
225
|
+
local_retry.__send__(:set!)
|
226
|
+
self.__send__(
|
227
|
+
:if,
|
228
|
+
self.inner.__send__(:bytecode_can_capture?)
|
229
|
+
) { |*| (g.push_temp_captures)}
|
230
|
+
self.inner.bytecode(g)
|
231
|
+
(Rubinius::Type.object_respond_to?(self.inlaid, :call).false? ? ::Myco::Void : self.inlaid.call)
|
232
|
+
self.__send__(
|
233
|
+
:if,
|
234
|
+
self.inner.__send__(:bytecode_can_capture?)
|
235
|
+
) { |*| (g.pop_to_accept_captures)}
|
236
|
+
g.pop
|
237
|
+
g.push_true
|
238
|
+
g.goto(local_retry)
|
239
|
+
local_fail.__send__(:set!)
|
240
|
+
self.__send__(
|
241
|
+
:if,
|
242
|
+
self.inner.__send__(:bytecode_can_capture?)
|
243
|
+
) { |*| (g.pop_to_reject_captures)}
|
244
|
+
g.__send__(
|
245
|
+
:overall_fail=,
|
246
|
+
old_fail
|
247
|
+
)
|
248
|
+
g.goto_if_false(g.overall_fail)
|
249
|
+
)}
|
250
|
+
))}
|
251
|
+
::Myco.find_constant(:ZeroOrOne).component_eval {(declare_meme(
|
252
|
+
:bytecode,
|
253
|
+
[],
|
254
|
+
::Object::Proc.new { |g| (
|
255
|
+
local_done = g.new_label
|
256
|
+
local_fail = g.new_label
|
257
|
+
old_fail = g.overall_fail
|
258
|
+
g.__send__(
|
259
|
+
:overall_fail=,
|
260
|
+
local_fail
|
261
|
+
)
|
262
|
+
self.__send__(
|
263
|
+
:if,
|
264
|
+
self.inner.__send__(:bytecode_can_capture?)
|
265
|
+
) { |*| (g.push_temp_captures)}
|
266
|
+
g.push_idx
|
267
|
+
self.inner.bytecode(g)
|
268
|
+
g.pop
|
269
|
+
self.__send__(
|
270
|
+
:if,
|
271
|
+
self.inner.__send__(:bytecode_can_capture?)
|
272
|
+
) { |*| (g.pop_to_accept_captures)}
|
273
|
+
g.__send__(
|
274
|
+
:overall_fail=,
|
275
|
+
old_fail
|
276
|
+
)
|
277
|
+
g.goto(local_done)
|
278
|
+
local_fail.__send__(:set!)
|
279
|
+
g.pop_to_set_idx
|
280
|
+
self.__send__(
|
281
|
+
:if,
|
282
|
+
self.inner.__send__(:bytecode_can_capture?)
|
283
|
+
) { |*| (g.pop_to_reject_captures)}
|
284
|
+
g.__send__(
|
285
|
+
:overall_fail=,
|
286
|
+
old_fail
|
287
|
+
)
|
288
|
+
local_done.__send__(:set!)
|
289
|
+
)}
|
290
|
+
))}
|
291
|
+
::Myco.find_constant(:ZeroOrMore).component_eval {(declare_meme(
|
292
|
+
:bytecode,
|
293
|
+
[],
|
294
|
+
::Object::Proc.new { |g| (
|
295
|
+
local_retry = g.new_label
|
296
|
+
local_fail = g.new_label
|
297
|
+
old_fail = g.overall_fail
|
298
|
+
g.__send__(
|
299
|
+
:overall_fail=,
|
300
|
+
local_fail
|
301
|
+
)
|
302
|
+
local_retry.__send__(:set!)
|
303
|
+
self.__send__(
|
304
|
+
:if,
|
305
|
+
self.inner.__send__(:bytecode_can_capture?)
|
306
|
+
) { |*| (g.push_temp_captures)}
|
307
|
+
self.inner.bytecode(g)
|
308
|
+
(Rubinius::Type.object_respond_to?(self.inlaid, :call).false? ? ::Myco::Void : self.inlaid.call)
|
309
|
+
self.__send__(
|
310
|
+
:if,
|
311
|
+
self.inner.__send__(:bytecode_can_capture?)
|
312
|
+
) { |*| (g.pop_to_accept_captures)}
|
313
|
+
g.goto(local_retry)
|
314
|
+
local_fail.__send__(:set!)
|
315
|
+
self.__send__(
|
316
|
+
:if,
|
317
|
+
self.inner.__send__(:bytecode_can_capture?)
|
318
|
+
) { |*| (g.pop_to_reject_captures)}
|
319
|
+
g.__send__(
|
320
|
+
:overall_fail=,
|
321
|
+
old_fail
|
322
|
+
)
|
323
|
+
)}
|
324
|
+
))}
|
325
|
+
::Myco.find_constant(:OrderedChoice).component_eval {(declare_meme(
|
326
|
+
:bytecode,
|
327
|
+
[],
|
328
|
+
::Object::Proc.new { |g| (
|
329
|
+
local_done = g.new_label
|
330
|
+
local_fail = g.new_label
|
331
|
+
old_fail = g.overall_fail
|
332
|
+
g.__send__(
|
333
|
+
:overall_fail=,
|
334
|
+
local_fail
|
335
|
+
)
|
336
|
+
self.__send__(
|
337
|
+
:if,
|
338
|
+
self.first.__send__(:bytecode_can_capture?)
|
339
|
+
) { |*| (g.push_temp_captures)}
|
340
|
+
g.push_idx
|
341
|
+
self.first.bytecode(g)
|
342
|
+
g.pop
|
343
|
+
self.__send__(
|
344
|
+
:if,
|
345
|
+
self.first.__send__(:bytecode_can_capture?)
|
346
|
+
) { |*| (g.pop_to_accept_captures)}
|
347
|
+
g.__send__(
|
348
|
+
:overall_fail=,
|
349
|
+
old_fail
|
350
|
+
)
|
351
|
+
g.goto(local_done)
|
352
|
+
local_fail.__send__(:set!)
|
353
|
+
g.pop_to_set_idx
|
354
|
+
self.__send__(
|
355
|
+
:if,
|
356
|
+
self.first.__send__(:bytecode_can_capture?)
|
357
|
+
) { |*| (g.pop_to_reject_captures)}
|
358
|
+
g.__send__(
|
359
|
+
:overall_fail=,
|
360
|
+
old_fail
|
361
|
+
)
|
362
|
+
self.second.bytecode(g)
|
363
|
+
local_done.__send__(:set!)
|
364
|
+
)}
|
365
|
+
))}
|
366
|
+
::Myco.find_constant(:Concatenation).component_eval {(declare_meme(
|
367
|
+
:bytecode,
|
368
|
+
[],
|
369
|
+
::Object::Proc.new { |g| (
|
370
|
+
self.first.bytecode(g)
|
371
|
+
self.second.bytecode(g)
|
372
|
+
)}
|
373
|
+
))}
|
294
374
|
)}
|
295
375
|
)}}
|
296
376
|
.tap { |__c__| __c__.__name__ = :Composite })}}.instance
|