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
data/lib/myco/core.my.rb
CHANGED
@@ -1,8 +1,24 @@
|
|
1
1
|
|
2
2
|
::Myco::Component.new([::Myco::FileToplevel], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
3
3
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
4
|
-
declare_meme(
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
declare_meme(
|
5
|
+
:"core/Object.my",
|
6
|
+
[:import],
|
7
|
+
::Object::Proc.new { |*| nil}
|
8
|
+
)
|
9
|
+
declare_meme(
|
10
|
+
:"core/Switch.my",
|
11
|
+
[:import],
|
12
|
+
::Object::Proc.new { |*| nil}
|
13
|
+
)
|
14
|
+
declare_meme(
|
15
|
+
:"core/Ruby.my",
|
16
|
+
[:import],
|
17
|
+
::Object::Proc.new { |*| nil}
|
18
|
+
)
|
19
|
+
declare_meme(
|
20
|
+
:"core/Loop.my",
|
21
|
+
[:import],
|
22
|
+
::Object::Proc.new { |*| nil}
|
23
|
+
)
|
8
24
|
)}}.instance
|
@@ -1,138 +1,230 @@
|
|
1
1
|
|
2
2
|
::Myco::Component.new([::Myco::FileToplevel], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
3
3
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(::Myco::BasicDecorators.component_eval {(__category__(:decorators).component_eval {(
|
4
|
-
declare_meme(
|
4
|
+
declare_meme(
|
5
|
+
:const,
|
6
|
+
[],
|
7
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:ConstDecorator))}
|
8
|
+
)
|
5
9
|
::Myco.cscope.for_method_definition::ConstDecorator = (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
6
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
7
|
-
:
|
8
|
-
|
9
|
-
|
10
|
-
declare_meme(:storage, [[:const, []]], nil, ::Myco.cscope.dup) { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
11
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
12
|
-
declare_meme(:apply, [], nil, ::Myco.cscope.dup) { |meme| (meme.target.declare_meme(:"#{meme.name}=") { |new_value, *args| (meme.set_result_for(
|
13
|
-
self,
|
14
|
-
new_value,
|
15
|
-
*args
|
16
|
-
))})}
|
17
|
-
__category__(:transforms).component_eval {(declare_meme(:cache, [], nil, ::Myco.cscope.dup) { |*| (true)})}
|
18
|
-
)}}.instance)}
|
19
|
-
declare_meme(:var, [[:const, []]], nil, ::Myco.cscope.dup) { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
20
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(__category__(:transforms).component_eval {(declare_meme(:var, [], nil, ::Myco.cscope.dup) { |*| (true)})})}}.instance)}
|
21
|
-
declare_meme(:memoize, [[:const, []]], nil, ::Myco.cscope.dup) { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
22
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(__category__(:transforms).component_eval {(declare_meme(:cache, [], nil, ::Myco.cscope.dup) { |*| (true)})})}}.instance)}
|
23
|
-
declare_meme(:static, [[:const, []]], nil, ::Myco.cscope.dup) { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
24
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(__category__(:transforms).component_eval {(declare_meme(:target, [], nil, ::Myco.cscope.dup) { |meme| (meme.target.singleton_class)})})}}.instance)}
|
25
|
-
declare_meme(:before, [[:const, []]], nil, ::Myco.cscope.dup) { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
26
|
-
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:apply, [], nil, ::Myco.cscope.dup) { |meme| (
|
27
|
-
orig_meme = meme.target.memes.__send__(
|
28
|
-
:[],
|
29
|
-
meme.name
|
30
|
-
)
|
31
|
-
wrap_meme = meme.dup
|
32
|
-
meme.__send__(
|
10
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
11
|
+
:apply,
|
12
|
+
[],
|
13
|
+
::Object::Proc.new { |meme| (meme.__send__(
|
33
14
|
:body=,
|
34
|
-
::
|
35
|
-
|
15
|
+
::Myco.find_constant(:Rubinius)::Thunk.new(meme.result)
|
16
|
+
))}
|
17
|
+
))}}.instance)
|
18
|
+
declare_meme(
|
19
|
+
:storage,
|
20
|
+
[:const],
|
21
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
22
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
23
|
+
declare_meme(
|
24
|
+
:apply,
|
25
|
+
[],
|
26
|
+
::Object::Proc.new { |meme| (meme.target.declare_meme(:"#{meme.name}=") { |new_value, *args| (meme.set_result_for(
|
36
27
|
self,
|
37
|
-
|
38
|
-
|
28
|
+
new_value,
|
29
|
+
*args
|
30
|
+
))})}
|
31
|
+
)
|
32
|
+
__category__(:transforms).component_eval {(declare_meme(
|
33
|
+
:cache,
|
34
|
+
[],
|
35
|
+
::Object::Proc.new { |*| (true)}
|
36
|
+
))}
|
37
|
+
)}}.instance)}
|
38
|
+
)
|
39
|
+
declare_meme(
|
40
|
+
:var,
|
41
|
+
[:const],
|
42
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
43
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(__category__(:transforms).component_eval {(declare_meme(
|
44
|
+
:var,
|
45
|
+
[],
|
46
|
+
::Object::Proc.new { |*| (true)}
|
47
|
+
))})}}.instance)}
|
48
|
+
)
|
49
|
+
declare_meme(
|
50
|
+
:memoize,
|
51
|
+
[:const],
|
52
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
53
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(__category__(:transforms).component_eval {(declare_meme(
|
54
|
+
:cache,
|
55
|
+
[],
|
56
|
+
::Object::Proc.new { |*| (true)}
|
57
|
+
))})}}.instance)}
|
58
|
+
)
|
59
|
+
declare_meme(
|
60
|
+
:static,
|
61
|
+
[:const],
|
62
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
63
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(__category__(:transforms).component_eval {(declare_meme(
|
64
|
+
:target,
|
65
|
+
[],
|
66
|
+
::Object::Proc.new { |meme| (meme.target.singleton_class)}
|
67
|
+
))})}}.instance)}
|
68
|
+
)
|
69
|
+
declare_meme(
|
70
|
+
:before,
|
71
|
+
[:const],
|
72
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
73
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
74
|
+
:apply,
|
75
|
+
[],
|
76
|
+
::Object::Proc.new { |meme| (
|
77
|
+
orig_meme = meme.target.memes.__send__(
|
78
|
+
:[],
|
79
|
+
meme.name
|
39
80
|
)
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
&b
|
81
|
+
wrap_meme = meme.dup
|
82
|
+
meme.__send__(
|
83
|
+
:body=,
|
84
|
+
::Object::Proc.new { |*a, &b| (
|
85
|
+
wrap_meme.result_for(
|
86
|
+
self,
|
87
|
+
*a,
|
88
|
+
&b
|
89
|
+
)
|
90
|
+
orig_meme.result_for(
|
91
|
+
self,
|
92
|
+
*a,
|
93
|
+
&b
|
94
|
+
)
|
95
|
+
)}
|
44
96
|
)
|
45
97
|
)}
|
46
|
-
)
|
47
|
-
)
|
48
|
-
declare_meme(
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
self,
|
60
|
-
*a,
|
61
|
-
&b
|
98
|
+
))}}.instance)}
|
99
|
+
)
|
100
|
+
declare_meme(
|
101
|
+
:after,
|
102
|
+
[:const],
|
103
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
104
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
105
|
+
:apply,
|
106
|
+
[],
|
107
|
+
::Object::Proc.new { |meme| (
|
108
|
+
orig_meme = meme.target.memes.__send__(
|
109
|
+
:[],
|
110
|
+
meme.name
|
62
111
|
)
|
63
|
-
wrap_meme.
|
64
|
-
|
65
|
-
|
66
|
-
&b
|
112
|
+
wrap_meme = meme.dup
|
113
|
+
meme.__send__(
|
114
|
+
:body=,
|
115
|
+
::Object::Proc.new { |*a, &b| (
|
116
|
+
result = orig_meme.result_for(
|
117
|
+
self,
|
118
|
+
*a,
|
119
|
+
&b
|
120
|
+
)
|
121
|
+
wrap_meme.result_for(
|
122
|
+
self,
|
123
|
+
*a,
|
124
|
+
&b
|
125
|
+
)
|
126
|
+
result
|
127
|
+
)}
|
67
128
|
)
|
68
|
-
result
|
69
129
|
)}
|
70
|
-
)
|
71
|
-
)
|
72
|
-
declare_meme(
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
self,
|
84
|
-
*a
|
130
|
+
))}}.instance)}
|
131
|
+
)
|
132
|
+
declare_meme(
|
133
|
+
:pre,
|
134
|
+
[:const],
|
135
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
136
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
137
|
+
:apply,
|
138
|
+
[],
|
139
|
+
::Object::Proc.new { |meme| (
|
140
|
+
orig_meme = meme.target.memes.__send__(
|
141
|
+
:[],
|
142
|
+
meme.name
|
85
143
|
)
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
&b
|
144
|
+
wrap_meme = meme.dup
|
145
|
+
meme.__send__(
|
146
|
+
:body=,
|
147
|
+
::Object::Proc.new { |*a, &b| (
|
148
|
+
new_a = wrap_meme.result_for(
|
149
|
+
self,
|
150
|
+
*a
|
151
|
+
)
|
152
|
+
orig_meme.result_for(
|
153
|
+
self,
|
154
|
+
*new_a,
|
155
|
+
&b
|
156
|
+
)
|
157
|
+
)}
|
90
158
|
)
|
91
159
|
)}
|
92
|
-
)
|
93
|
-
)
|
94
|
-
declare_meme(
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
self,
|
106
|
-
*a,
|
107
|
-
&b
|
160
|
+
))}}.instance)}
|
161
|
+
)
|
162
|
+
declare_meme(
|
163
|
+
:post,
|
164
|
+
[:const],
|
165
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
166
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
167
|
+
:apply,
|
168
|
+
[],
|
169
|
+
::Object::Proc.new { |meme| (
|
170
|
+
orig_meme = meme.target.memes.__send__(
|
171
|
+
:[],
|
172
|
+
meme.name
|
108
173
|
)
|
109
|
-
wrap_meme.
|
110
|
-
|
111
|
-
|
174
|
+
wrap_meme = meme.dup
|
175
|
+
meme.__send__(
|
176
|
+
:body=,
|
177
|
+
::Object::Proc.new { |*a, &b| (
|
178
|
+
result = orig_meme.result_for(
|
179
|
+
self,
|
180
|
+
*a,
|
181
|
+
&b
|
182
|
+
)
|
183
|
+
wrap_meme.result_for(
|
184
|
+
self,
|
185
|
+
result
|
186
|
+
)
|
187
|
+
)}
|
112
188
|
)
|
113
189
|
)}
|
114
|
-
)
|
115
|
-
)
|
116
|
-
declare_meme(
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
190
|
+
))}}.instance)}
|
191
|
+
)
|
192
|
+
declare_meme(
|
193
|
+
:setter,
|
194
|
+
[:const],
|
195
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
196
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
197
|
+
:apply,
|
198
|
+
[],
|
199
|
+
::Object::Proc.new { |meme| (
|
200
|
+
wrap_meme = meme.dup
|
201
|
+
meme.__send__(
|
202
|
+
:setter=,
|
203
|
+
::Object::Proc.new { |orig_value| (wrap_meme.result_for(
|
204
|
+
self,
|
205
|
+
orig_value
|
206
|
+
))}
|
207
|
+
)
|
208
|
+
)}
|
209
|
+
))}}.instance)}
|
210
|
+
)
|
211
|
+
declare_meme(
|
212
|
+
:getter,
|
213
|
+
[:const],
|
214
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Decorator)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
215
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
|
216
|
+
:apply,
|
217
|
+
[],
|
218
|
+
::Object::Proc.new { |meme| (
|
219
|
+
wrap_meme = meme.dup
|
220
|
+
meme.__send__(
|
221
|
+
:getter=,
|
222
|
+
::Object::Proc.new { |orig_value| (wrap_meme.result_for(
|
223
|
+
self,
|
224
|
+
orig_value
|
225
|
+
))}
|
226
|
+
)
|
227
|
+
)}
|
228
|
+
))}}.instance)}
|
229
|
+
)
|
138
230
|
)})})}}.instance
|
@@ -1,49 +1,113 @@
|
|
1
1
|
|
2
2
|
::Myco::Component.new([::Myco::FileToplevel], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
3
3
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(::Myco::BasicObject.component_eval {(
|
4
|
-
declare_meme(
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
declare_meme(
|
4
|
+
declare_meme(
|
5
|
+
:if,
|
6
|
+
[],
|
7
|
+
::Object::Proc.new { |cond, &blk| (::Myco.branch_op(:"&&", cond) {blk.call})}
|
8
|
+
)
|
9
|
+
declare_meme(
|
10
|
+
:unless,
|
11
|
+
[],
|
12
|
+
::Object::Proc.new { |cond, &blk| (::Myco.branch_op(:"||", cond) {blk.call})}
|
13
|
+
)
|
14
|
+
declare_meme(
|
15
|
+
:case,
|
16
|
+
[],
|
17
|
+
::Object::Proc.new { |input, *rest| (
|
18
|
+
use_strategy = ::Myco.branch_op(:"&&", rest.size.__send__(:odd?)) {rest.pop}
|
19
|
+
rest.each_slice(2).detect { |test_value, strategy| (::Myco.branch_op(:"&&", test_value.__send__(
|
20
|
+
:==,
|
21
|
+
input
|
22
|
+
)) {(
|
23
|
+
use_strategy = strategy
|
24
|
+
true
|
25
|
+
)})}
|
26
|
+
::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", use_strategy) {::Myco.branch_op(:"??", (Rubinius::Type.object_respond_to?(use_strategy, :call).false? ? ::Myco::Void : use_strategy.call(input))) {use_strategy}}) {self.raise("No match for case(#{input})")}
|
27
|
+
)}
|
28
|
+
)
|
29
|
+
declare_meme(
|
30
|
+
:cond,
|
31
|
+
[],
|
32
|
+
::Object::Proc.new { |*rest| (
|
33
|
+
use_strategy = ::Myco.branch_op(:"&&", rest.size.__send__(:odd?)) {rest.pop}
|
34
|
+
rest.each_slice(2).detect { |test_value, strategy| (::Myco.branch_op(:"&&", ::Myco.branch_op(:"??", (Rubinius::Type.object_respond_to?(test_value, :call).false? ? ::Myco::Void : test_value.call)) {test_value}) {(
|
35
|
+
use_strategy = strategy
|
36
|
+
true
|
37
|
+
)})}
|
38
|
+
::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", use_strategy) {::Myco.branch_op(:"??", (Rubinius::Type.object_respond_to?(use_strategy, :call).false? ? ::Myco::Void : use_strategy.call)) {use_strategy}}) {self.raise("No match for cond")}
|
39
|
+
)}
|
40
|
+
)
|
41
|
+
declare_meme(
|
42
|
+
:switch,
|
43
|
+
[],
|
44
|
+
::Object::Proc.new { |input, comparator=:==| (::Myco.find_constant(:Switch).new({
|
45
|
+
:input => input,
|
46
|
+
:comparator => comparator
|
47
|
+
}))}
|
48
|
+
)
|
49
|
+
declare_meme(
|
30
50
|
:raise,
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
declare_meme(
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
51
|
+
[],
|
52
|
+
::Object::Proc.new { |*args| (::Object.__send__(
|
53
|
+
:raise,
|
54
|
+
*args
|
55
|
+
))}
|
56
|
+
)
|
57
|
+
declare_meme(
|
58
|
+
:loop,
|
59
|
+
[],
|
60
|
+
::Object::Proc.new { |&block| (::Myco.find_constant(:Loop).run(&block))}
|
61
|
+
)
|
62
|
+
declare_meme(
|
63
|
+
:break,
|
64
|
+
[],
|
65
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:Loop).__send__(:break))}
|
66
|
+
)
|
67
|
+
declare_meme(
|
68
|
+
:send,
|
69
|
+
[],
|
70
|
+
::Object::Proc.new { |*args, &block| (self.__send__(
|
71
|
+
*args,
|
72
|
+
&block
|
73
|
+
))}
|
74
|
+
)
|
75
|
+
declare_meme(
|
76
|
+
:kind_of?,
|
77
|
+
[],
|
78
|
+
::Object::Proc.new { |mod| (self.__kind_of__(mod))}
|
79
|
+
)
|
80
|
+
declare_meme(
|
81
|
+
:is_a?,
|
82
|
+
[],
|
83
|
+
::Object::Proc.new { |mod| (self.__kind_of__(mod))}
|
84
|
+
)
|
85
|
+
declare_meme(
|
86
|
+
:class,
|
87
|
+
[],
|
88
|
+
::Object::Proc.new { |*| (self.__class__)}
|
89
|
+
)
|
90
|
+
declare_meme(
|
91
|
+
:dup,
|
92
|
+
[],
|
93
|
+
::Object::Proc.new { |*| (self.__dup__)}
|
94
|
+
)
|
95
|
+
declare_meme(
|
96
|
+
:puts,
|
97
|
+
[],
|
98
|
+
::Object::Proc.new { |*args| (::Myco.find_constant(:STDOUT).puts(*args))}
|
99
|
+
)
|
100
|
+
declare_meme(
|
101
|
+
:p,
|
102
|
+
[],
|
103
|
+
::Object::Proc.new { |*args| (::Myco.find_constant(:STDOUT).puts(args.map { |a| (a.inspect)}.join(", ")))}
|
104
|
+
)
|
105
|
+
declare_meme(
|
106
|
+
:ruby_require,
|
107
|
+
[],
|
108
|
+
::Object::Proc.new { |arg| (::Object.send(
|
109
|
+
:require,
|
110
|
+
arg
|
111
|
+
))}
|
112
|
+
)
|
49
113
|
)})}}.instance
|