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
@@ -4,82 +4,102 @@
|
|
4
4
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
5
5
|
::Myco.cscope.for_method_definition::State = ::Myco::Component.new([::Myco.find_constant(:Common)::Parser::State], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
6
6
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
7
|
-
declare_meme(
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
7
|
+
declare_meme(
|
8
|
+
:string,
|
9
|
+
[:var],
|
10
|
+
::Object::Proc.new { |*| nil}
|
11
|
+
)
|
12
|
+
declare_meme(
|
13
|
+
:error_row,
|
14
|
+
[:var],
|
15
|
+
::Object::Proc.new { |*| nil}
|
16
|
+
)
|
17
|
+
declare_meme(
|
18
|
+
:error_col,
|
19
|
+
[:var],
|
20
|
+
::Object::Proc.new { |*| nil}
|
21
|
+
)
|
22
|
+
declare_meme(
|
23
|
+
:raise_error,
|
24
|
+
[],
|
25
|
+
::Object::Proc.new { |*| (::Myco.branch_op(:"&&", self.error_idx) {self.raise(
|
26
|
+
::Myco.find_constant(:SyntaxError),
|
27
|
+
"Unexpected character with parser: #{self.rule} near line: #{self.error_row}, column: #{self.error_col}.\n#{self.string.each_line.to_a.__send__(
|
28
|
+
:[],
|
29
|
+
self.error_row.__send__(
|
22
30
|
:-,
|
23
31
|
1
|
24
|
-
)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
32
|
+
)
|
33
|
+
)}#{" ".__send__(
|
34
|
+
:*,
|
35
|
+
[
|
36
|
+
self.error_col.__send__(
|
37
|
+
:-,
|
38
|
+
1
|
39
|
+
),
|
40
|
+
0
|
41
|
+
].max
|
42
|
+
)}^"
|
43
|
+
)})}
|
44
|
+
)
|
29
45
|
)}}
|
30
46
|
.tap { |__c__| __c__.__name__ = :State }
|
31
|
-
declare_meme(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
state.rule,
|
43
|
-
state.string,
|
44
|
-
state.start_idx
|
45
|
-
)
|
46
|
-
)
|
47
|
-
::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", state.end_idx) {(
|
48
|
-
processor.__send__(
|
49
|
-
:string=,
|
50
|
-
state.string
|
51
|
-
)
|
52
|
-
processor.__send__(
|
53
|
-
:capture_items=,
|
54
|
-
self.captures_of_worker(worker)
|
55
|
-
)
|
56
|
-
::Myco.branch_op(:"&&", (Rubinius::Type.object_respond_to?(self.grammar, :tokenizer).false? ? ::Myco::Void : self.grammar.tokenizer)) {processor.__send__(
|
57
|
-
:tokenizer=,
|
58
|
-
self.grammar.tokenizer
|
59
|
-
)}
|
60
|
-
state.__send__(
|
61
|
-
:result=,
|
62
|
-
processor.process
|
63
|
-
)
|
64
|
-
)}) {(
|
65
|
-
state.__send__(
|
66
|
-
:error_idx=,
|
67
|
-
self.highest_idx_of_worker(worker)
|
68
|
-
)
|
69
|
-
pos = processor.position_of(
|
70
|
-
state.error_idx,
|
71
|
-
state.string
|
72
|
-
)
|
73
|
-
state.__send__(
|
74
|
-
:error_row=,
|
75
|
-
pos.first
|
76
|
-
)
|
47
|
+
declare_meme(
|
48
|
+
:parse,
|
49
|
+
[],
|
50
|
+
::Object::Proc.new { |string, rule:"root", start_idx:0| (
|
51
|
+
worker = self.new_worker
|
52
|
+
processor = self.new_processor
|
53
|
+
state = ::Myco.find_constant(:State).new({
|
54
|
+
:string => string.to_s,
|
55
|
+
:rule => rule.to_sym,
|
56
|
+
:start_idx => start_idx.to_i
|
57
|
+
})
|
77
58
|
state.__send__(
|
78
|
-
:
|
79
|
-
|
59
|
+
:end_idx=,
|
60
|
+
worker.__send__(
|
61
|
+
state.rule,
|
62
|
+
state.string,
|
63
|
+
state.start_idx
|
64
|
+
)
|
80
65
|
)
|
66
|
+
::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", state.end_idx) {(
|
67
|
+
processor.__send__(
|
68
|
+
:string=,
|
69
|
+
state.string
|
70
|
+
)
|
71
|
+
processor.__send__(
|
72
|
+
:capture_items=,
|
73
|
+
self.captures_of_worker(worker)
|
74
|
+
)
|
75
|
+
::Myco.branch_op(:"&&", (Rubinius::Type.object_respond_to?(self.grammar, :tokenizer).false? ? ::Myco::Void : self.grammar.tokenizer)) {processor.__send__(
|
76
|
+
:tokenizer=,
|
77
|
+
self.grammar.tokenizer
|
78
|
+
)}
|
79
|
+
state.__send__(
|
80
|
+
:result=,
|
81
|
+
processor.process
|
82
|
+
)
|
83
|
+
)}) {(
|
84
|
+
state.__send__(
|
85
|
+
:error_idx=,
|
86
|
+
self.highest_idx_of_worker(worker)
|
87
|
+
)
|
88
|
+
pos = processor.position_of(
|
89
|
+
state.error_idx,
|
90
|
+
state.string
|
91
|
+
)
|
92
|
+
state.__send__(
|
93
|
+
:error_row=,
|
94
|
+
pos.first
|
95
|
+
)
|
96
|
+
state.__send__(
|
97
|
+
:error_col=,
|
98
|
+
pos.last
|
99
|
+
)
|
100
|
+
)}
|
101
|
+
state
|
81
102
|
)}
|
82
|
-
|
83
|
-
)}
|
103
|
+
)
|
84
104
|
)}}
|
85
105
|
.tap { |__c__| __c__.__name__ = :Parser })})}}.instance
|
data/lib/myco/command.my.rb
CHANGED
@@ -1,34 +1,94 @@
|
|
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(
|
4
|
+
declare_meme(
|
5
|
+
:"tools/BasicCommand.my",
|
6
|
+
[:import],
|
7
|
+
::Object::Proc.new { |*| nil}
|
8
|
+
)
|
5
9
|
::Myco::Component.new([::Myco.find_constant(:BasicCommand)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
6
10
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
7
|
-
declare_meme(
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
declare_meme(
|
12
|
+
:banner,
|
13
|
+
[],
|
14
|
+
::Object::Proc.new { |*| ("Usage: myco [subcommand] [options] [files]")}
|
15
|
+
)
|
16
|
+
declare_meme(
|
17
|
+
:creation,
|
18
|
+
[:on],
|
19
|
+
::Object::Proc.new { |*| (self.run(*::Myco.find_constant(:ARGV)))}
|
20
|
+
)
|
21
|
+
declare_meme(
|
22
|
+
:run,
|
23
|
+
[],
|
24
|
+
::Object::Proc.new { |*argv| (
|
25
|
+
files = self.options_parse(*argv)
|
26
|
+
::Myco.branch_op(:"&&", files) {files.uniq.each { |file| (::Myco.find_constant(:Myco).eval_file(
|
27
|
+
file,
|
28
|
+
[::Myco.find_constant(:Dir).pwd]
|
29
|
+
))}}
|
30
|
+
)}
|
31
|
+
)
|
16
32
|
__category__(:options).component_eval {(
|
17
|
-
declare_meme(
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
33
|
+
declare_meme(
|
34
|
+
:"-E",
|
35
|
+
[],
|
36
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Option)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
37
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
38
|
+
declare_meme(
|
39
|
+
:description,
|
40
|
+
[],
|
41
|
+
::Object::Proc.new { |*| ("Evaluate a string of declarative Myco")}
|
42
|
+
)
|
43
|
+
declare_meme(
|
44
|
+
:long_form,
|
45
|
+
[],
|
46
|
+
::Object::Proc.new { |*| ("--eval")}
|
47
|
+
)
|
48
|
+
declare_meme(
|
49
|
+
:argument,
|
50
|
+
[],
|
51
|
+
::Object::Proc.new { |*| ("STRING")}
|
52
|
+
)
|
53
|
+
declare_meme(
|
54
|
+
:do,
|
55
|
+
[],
|
56
|
+
::Object::Proc.new { |arg| (::Myco.find_constant(:Myco).eval(arg))}
|
57
|
+
)
|
58
|
+
)}}.instance)}
|
59
|
+
)
|
60
|
+
declare_meme(
|
61
|
+
:"-e",
|
62
|
+
[],
|
63
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Option)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
64
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
65
|
+
declare_meme(
|
66
|
+
:description,
|
67
|
+
[],
|
68
|
+
::Object::Proc.new { |*| ("Evaluate a string of procedural Myco inside an Object")}
|
69
|
+
)
|
70
|
+
declare_meme(
|
71
|
+
:long_form,
|
72
|
+
[],
|
73
|
+
::Object::Proc.new { |*| ("--eval-meme")}
|
74
|
+
)
|
75
|
+
declare_meme(
|
76
|
+
:argument,
|
77
|
+
[],
|
78
|
+
::Object::Proc.new { |*| ("STRING")}
|
79
|
+
)
|
80
|
+
declare_meme(
|
81
|
+
:do,
|
82
|
+
[],
|
83
|
+
::Object::Proc.new { |arg| (::Myco.find_constant(:Myco).eval("Object { on creation: { #{arg} } }"))}
|
84
|
+
)
|
85
|
+
)}}.instance)}
|
86
|
+
)
|
31
87
|
)}
|
32
|
-
__category__(:commands).component_eval {(declare_meme(
|
88
|
+
__category__(:commands).component_eval {(declare_meme(
|
89
|
+
:inoculate,
|
90
|
+
[],
|
91
|
+
::Object::Proc.new { |*| (::Myco.find_constant(:Myco).eval_file("command/inoculate.my"))}
|
92
|
+
))}
|
33
93
|
)}}.instance
|
34
94
|
)}}.instance
|
@@ -1,151 +1,243 @@
|
|
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(
|
4
|
+
declare_meme(
|
5
|
+
:"../tools/BasicCommand.my",
|
6
|
+
[:import],
|
7
|
+
::Object::Proc.new { |*| nil}
|
8
|
+
)
|
5
9
|
::Myco::Component.new([::Myco.find_constant(:BasicCommand)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
6
10
|
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
7
|
-
declare_meme(
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
)
|
12
|
-
declare_meme(
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
11
|
+
declare_meme(
|
12
|
+
:banner,
|
13
|
+
[],
|
14
|
+
::Object::Proc.new { |*| ("Usage: myco inoculate [options]")}
|
15
|
+
)
|
16
|
+
declare_meme(
|
17
|
+
:shell,
|
18
|
+
[],
|
19
|
+
::Object::Proc.new { |*a, &b| (::Myco.find_constant(:Kernel).instance_method(:system).bind(self).call(
|
20
|
+
*a,
|
21
|
+
&b
|
22
|
+
))}
|
23
|
+
)
|
24
|
+
declare_meme(
|
25
|
+
:run,
|
26
|
+
[],
|
27
|
+
::Object::Proc.new { |*argv| (
|
28
|
+
destinations = self.options_parse(*argv)
|
29
|
+
::Myco.branch_op(:"??", ::Myco.branch_op(:"|?", destinations.size.__send__(
|
30
|
+
:==,
|
31
|
+
1
|
32
|
+
)) {self.show_help}) {destinations.each { |dest| (
|
33
|
+
self.config.__send__(
|
34
|
+
:dest=,
|
35
|
+
dest
|
27
36
|
)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
37
|
+
self.run_operation(
|
38
|
+
:copy,
|
39
|
+
self.files(
|
40
|
+
self.config.source,
|
41
|
+
"*.md"
|
42
|
+
)
|
34
43
|
)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
44
|
+
self.run_operation(
|
45
|
+
:copy,
|
46
|
+
self.files(
|
47
|
+
self.config.source,
|
48
|
+
"LICENSE"
|
49
|
+
)
|
41
50
|
)
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
51
|
+
self.run_operation(
|
52
|
+
:copy,
|
53
|
+
self.files(
|
54
|
+
self.config.source,
|
55
|
+
"bin/*"
|
56
|
+
)
|
48
57
|
)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
58
|
+
self.run_operation(
|
59
|
+
:copy,
|
60
|
+
self.files(
|
61
|
+
self.config.source,
|
62
|
+
"lib/**/*.rb"
|
63
|
+
)
|
55
64
|
)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
65
|
+
self.run_operation(
|
66
|
+
:copy,
|
67
|
+
self.files(
|
68
|
+
self.config.source,
|
69
|
+
"lib/**/*.my"
|
70
|
+
)
|
62
71
|
)
|
72
|
+
self.run_operation(
|
73
|
+
:myrb,
|
74
|
+
self.files(
|
75
|
+
self.config.dest,
|
76
|
+
"lib/**/*.my"
|
77
|
+
)
|
78
|
+
)
|
79
|
+
self.__send__(
|
80
|
+
:if,
|
81
|
+
self.config.verbose
|
82
|
+
) { |*| (
|
83
|
+
prog = ::Myco.find_constant(:Rubinius)::Globals.__send__(
|
84
|
+
:[],
|
85
|
+
:$PROGRAM_NAME
|
86
|
+
)
|
87
|
+
self.puts("DONE #{prog} #{::Myco.find_constant(:ARGV).join(" ")}")
|
88
|
+
)}
|
89
|
+
)}}
|
90
|
+
)}
|
91
|
+
)
|
92
|
+
declare_meme(
|
93
|
+
:run_operation,
|
94
|
+
[],
|
95
|
+
::Object::Proc.new { |opcode, source_list| (source_list.each { |source| (
|
96
|
+
dest = self.transforms.send(
|
97
|
+
opcode,
|
98
|
+
source
|
63
99
|
)
|
64
100
|
self.__send__(
|
65
|
-
:
|
66
|
-
self.
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
self.operation_is_unnecessary(
|
84
|
-
source,
|
85
|
-
dest
|
86
|
-
)
|
87
|
-
) { || (
|
88
|
-
self.__send__(
|
89
|
-
:if,
|
90
|
-
self.config.verbose
|
91
|
-
) { || (
|
92
|
-
self.puts("#{opcode.upcase} #{source}")
|
93
|
-
self.puts(" => #{dest}")
|
101
|
+
:unless,
|
102
|
+
self.operation_is_unnecessary(
|
103
|
+
source,
|
104
|
+
dest
|
105
|
+
)
|
106
|
+
) { |*| (
|
107
|
+
self.__send__(
|
108
|
+
:if,
|
109
|
+
self.config.verbose
|
110
|
+
) { |*| (
|
111
|
+
self.puts("#{opcode.upcase} #{source}")
|
112
|
+
self.puts(" => #{dest}")
|
113
|
+
)}
|
114
|
+
self.operations.send(
|
115
|
+
opcode,
|
116
|
+
source,
|
117
|
+
dest
|
118
|
+
)
|
94
119
|
)}
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
)
|
101
|
-
|
102
|
-
|
103
|
-
:
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
glob
|
112
|
-
|
120
|
+
)})}
|
121
|
+
)
|
122
|
+
declare_meme(
|
123
|
+
:operation_is_unnecessary,
|
124
|
+
[],
|
125
|
+
::Object::Proc.new { |source, dest| (::Myco.branch_op(:"&&", ::Myco.find_constant(:File).__send__(
|
126
|
+
:file?,
|
127
|
+
dest
|
128
|
+
)) {::Myco.find_constant(:File).mtime(dest).__send__(
|
129
|
+
:>=,
|
130
|
+
::Myco.find_constant(:File).mtime(source)
|
131
|
+
)})}
|
132
|
+
)
|
133
|
+
declare_meme(
|
134
|
+
:files,
|
135
|
+
[],
|
136
|
+
::Object::Proc.new { |prefix, glob| (::Myco.find_constant(:Dir).glob(::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", prefix) {::Myco.find_constant(:File).join(
|
137
|
+
prefix,
|
138
|
+
glob
|
139
|
+
)}) {glob}))}
|
140
|
+
)
|
113
141
|
__category__(:operations).component_eval {(
|
114
|
-
declare_meme(
|
115
|
-
|
142
|
+
declare_meme(
|
143
|
+
:copy,
|
144
|
+
[],
|
145
|
+
::Object::Proc.new { |source, dest| (self.shell("mkdir -p #{::Myco.find_constant(:File).dirname(dest)} && cp #{source} #{dest}"))}
|
146
|
+
)
|
147
|
+
declare_meme(
|
148
|
+
:myrb,
|
149
|
+
[],
|
150
|
+
::Object::Proc.new { |source, dest| (::Myco.find_constant(:Myco)::CodeLoader::MycoLoader.new(source).__send__(:emit_rb!))}
|
151
|
+
)
|
116
152
|
)}
|
117
153
|
__category__(:transforms).component_eval {(
|
118
|
-
declare_meme(
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
154
|
+
declare_meme(
|
155
|
+
:copy,
|
156
|
+
[],
|
157
|
+
::Object::Proc.new { |filename| (::Myco.find_constant(:File).join(
|
158
|
+
self.config.dest,
|
159
|
+
filename
|
160
|
+
))}
|
161
|
+
)
|
162
|
+
declare_meme(
|
163
|
+
:myrb,
|
164
|
+
[],
|
165
|
+
::Object::Proc.new { |filename| ("#{filename}.rb")}
|
166
|
+
)
|
123
167
|
)}
|
124
168
|
__category__(:config).component_eval {(
|
125
|
-
declare_meme(
|
126
|
-
|
127
|
-
|
169
|
+
declare_meme(
|
170
|
+
:source,
|
171
|
+
[:var],
|
172
|
+
::Object::Proc.new { |*| nil}
|
173
|
+
)
|
174
|
+
declare_meme(
|
175
|
+
:dest,
|
176
|
+
[:var],
|
177
|
+
::Object::Proc.new { |*| nil}
|
178
|
+
)
|
179
|
+
declare_meme(
|
180
|
+
:verbose,
|
181
|
+
[:var],
|
182
|
+
::Object::Proc.new { |*| nil}
|
183
|
+
)
|
128
184
|
)}
|
129
185
|
__category__(:options).component_eval {(
|
130
|
-
declare_meme(
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
186
|
+
declare_meme(
|
187
|
+
:"-d",
|
188
|
+
[],
|
189
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Option)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
190
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
191
|
+
declare_meme(
|
192
|
+
:description,
|
193
|
+
[],
|
194
|
+
::Object::Proc.new { |*| ("The destination directory to clone material into.")}
|
195
|
+
)
|
196
|
+
declare_meme(
|
197
|
+
:long_form,
|
198
|
+
[],
|
199
|
+
::Object::Proc.new { |*| ("--dest")}
|
200
|
+
)
|
201
|
+
declare_meme(
|
202
|
+
:argument,
|
203
|
+
[],
|
204
|
+
::Object::Proc.new { |*| ("STRING")}
|
205
|
+
)
|
206
|
+
declare_meme(
|
207
|
+
:do,
|
208
|
+
[],
|
209
|
+
::Object::Proc.new { |arg| (self.parent.config.__send__(
|
210
|
+
:dest=,
|
211
|
+
arg
|
212
|
+
))}
|
213
|
+
)
|
214
|
+
)}}.instance)}
|
215
|
+
)
|
216
|
+
declare_meme(
|
217
|
+
:"-v",
|
218
|
+
[],
|
219
|
+
::Object::Proc.new { |*| (::Myco::Component.new([::Myco.find_constant(:Option)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
|
220
|
+
.tap { |__c__| __c__.__last__ = __c__.component_eval {(
|
221
|
+
declare_meme(
|
222
|
+
:description,
|
223
|
+
[],
|
224
|
+
::Object::Proc.new { |*| ("Show details about material cloning operations.")}
|
225
|
+
)
|
226
|
+
declare_meme(
|
227
|
+
:long_form,
|
228
|
+
[],
|
229
|
+
::Object::Proc.new { |*| ("--verbose")}
|
230
|
+
)
|
231
|
+
declare_meme(
|
232
|
+
:do,
|
233
|
+
[],
|
234
|
+
::Object::Proc.new { |arg| (self.parent.config.__send__(
|
235
|
+
:verbose=,
|
236
|
+
true
|
237
|
+
))}
|
238
|
+
)
|
239
|
+
)}}.instance)}
|
240
|
+
)
|
149
241
|
)}
|
150
242
|
)}}.instance
|
151
243
|
)}}.instance
|