myco 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/lib/myco/bootstrap.my.rb +50 -14
  3. data/lib/myco/bootstrap/add_method.rb +5 -5
  4. data/lib/myco/bootstrap/meme.rb +2 -1
  5. data/lib/myco/code_tools/AST.my.rb +211 -43
  6. data/lib/myco/code_tools/AST/ArgumentAssembly.my.rb +92 -48
  7. data/lib/myco/code_tools/AST/ArrayAssembly.my.rb +39 -27
  8. data/lib/myco/code_tools/AST/Block.my.rb +176 -112
  9. data/lib/myco/code_tools/AST/BlockArgument.my.rb +29 -17
  10. data/lib/myco/code_tools/AST/BlockLiteral.my.rb +37 -17
  11. data/lib/myco/code_tools/AST/BlockParameter.my.rb +25 -9
  12. data/lib/myco/code_tools/AST/BranchOperator.my.rb +95 -75
  13. data/lib/myco/code_tools/AST/ConstantAccess.my.rb +52 -32
  14. data/lib/myco/code_tools/AST/ConstantAssignment.my.rb +52 -36
  15. data/lib/myco/code_tools/AST/ConstantDefine.my.rb +50 -26
  16. data/lib/myco/code_tools/AST/DeclareCategory.my.rb +38 -18
  17. data/lib/myco/code_tools/AST/DeclareExtension.my.rb +29 -13
  18. data/lib/myco/code_tools/AST/DeclareFile.my.rb +51 -31
  19. data/lib/myco/code_tools/AST/DeclareMeme.my.rb +96 -68
  20. data/lib/myco/code_tools/AST/DeclareObject.my.rb +66 -42
  21. data/lib/myco/code_tools/AST/DeclareString.my.rb +39 -19
  22. data/lib/myco/code_tools/AST/DeclaredScope.my.rb +92 -64
  23. data/lib/myco/code_tools/AST/Invoke.my +8 -4
  24. data/lib/myco/code_tools/AST/Invoke.my.rb +74 -31
  25. data/lib/myco/code_tools/AST/InvokeMethod.my.rb +34 -14
  26. data/lib/myco/code_tools/AST/KeywordAssembly.my.rb +36 -24
  27. data/lib/myco/code_tools/AST/KeywordOptionalParameter.my.rb +28 -8
  28. data/lib/myco/code_tools/AST/KeywordRequiredParameter.my.rb +23 -7
  29. data/lib/myco/code_tools/AST/KeywordRestParameter.my.rb +23 -7
  30. data/lib/myco/code_tools/AST/LocalVariableAccessAmbiguous.my.rb +24 -12
  31. data/lib/myco/code_tools/AST/LocalVariableAssignment.my.rb +30 -10
  32. data/lib/myco/code_tools/AST/Node.my.rb +234 -102
  33. data/lib/myco/code_tools/AST/NumericLiteral.my.rb +18 -6
  34. data/lib/myco/code_tools/AST/OptionalParameter.my.rb +33 -13
  35. data/lib/myco/code_tools/AST/ParameterAssembly.my.rb +275 -211
  36. data/lib/myco/code_tools/AST/PipeOperator.my.rb +42 -18
  37. data/lib/myco/code_tools/AST/Quest.my.rb +65 -37
  38. data/lib/myco/code_tools/AST/RequiredParameter.my.rb +20 -4
  39. data/lib/myco/code_tools/AST/RestParameter.my.rb +20 -4
  40. data/lib/myco/code_tools/AST/Script.my.rb +51 -23
  41. data/lib/myco/code_tools/AST/Sequence.my.rb +22 -10
  42. data/lib/myco/code_tools/AST/SplatValue.my.rb +28 -16
  43. data/lib/myco/code_tools/AST/StringCompose.my.rb +23 -11
  44. data/lib/myco/code_tools/AST/StringLiteral.my.rb +19 -7
  45. data/lib/myco/code_tools/AST/SymbolCompose.my.rb +27 -15
  46. data/lib/myco/code_tools/AST/SymbolLiteral.my.rb +18 -6
  47. data/lib/myco/code_tools/AST/ToRuby.my.rb +581 -341
  48. data/lib/myco/code_tools/AST/misc.my.rb +87 -35
  49. data/lib/myco/code_tools/Parser.my.rb +39 -12
  50. data/lib/myco/code_tools/parser/MycoBuilder.my.rb +106 -90
  51. data/lib/myco/code_tools/parser/MycoCharacterClasses.my.rb +98 -50
  52. data/lib/myco/code_tools/parser/MycoGrammar.my +1 -6
  53. data/lib/myco/code_tools/parser/MycoGrammar.my.rb +2124 -1710
  54. data/lib/myco/code_tools/parser/MycoTokens.my +0 -5
  55. data/lib/myco/code_tools/parser/MycoTokens.my.rb +387 -156
  56. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces.my.rb +55 -11
  57. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/BytecodeHelpers.my.rb +321 -205
  58. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Capture.my.rb +223 -127
  59. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Common.my.rb +188 -72
  60. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Common/Parser.my +48 -0
  61. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Common/Parser.my.rb +365 -189
  62. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Composite.my.rb +313 -233
  63. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Grammar.my.rb +99 -55
  64. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Processor.my.rb +493 -325
  65. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Stream.my.rb +138 -114
  66. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Stream/Parser.my.rb +56 -44
  67. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/String.my.rb +173 -93
  68. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/String/Parser.my.rb +90 -70
  69. data/lib/myco/command.my.rb +85 -25
  70. data/lib/myco/command/inoculate.my.rb +219 -127
  71. data/lib/myco/core.my.rb +20 -4
  72. data/lib/myco/core/BasicDecorators.my.rb +211 -119
  73. data/lib/myco/core/BasicObject.my.rb +108 -44
  74. data/lib/myco/core/Category.my.rb +37 -13
  75. data/lib/myco/core/Decorator.my.rb +35 -27
  76. data/lib/myco/core/FileToplevel.my.rb +55 -27
  77. data/lib/myco/core/Loop.my.rb +16 -8
  78. data/lib/myco/core/Object.my.rb +34 -14
  79. data/lib/myco/core/Ruby.my.rb +13 -5
  80. data/lib/myco/core/Switch.my.rb +79 -47
  81. data/lib/myco/tools/BasicCommand.my.rb +79 -47
  82. data/lib/myco/tools/mycompile.my.rb +153 -69
  83. data/lib/myco/version.rb +1 -1
  84. metadata +34 -52
  85. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Parser.my +0 -144
  86. data/lib/myco/code_tools/parser/pegleromyces/lib/pegleromyces/Parser.my.rb +0 -221
  87. data/lib/myco/code_tools/parser/pegleromyces/spec/BasicSpec.my +0 -35
  88. data/lib/myco/code_tools/parser/pegleromyces/spec/BasicSpec.my.rb +0 -35
  89. data/lib/myco/code_tools/parser/pegleromyces/spec/Grammar.test.my +0 -10
  90. data/lib/myco/code_tools/parser/pegleromyces/spec/Grammar.test.my.rb +0 -9
  91. data/lib/myco/code_tools/parser/pegleromyces/spec/Patterns.test.my +0 -162
  92. data/lib/myco/code_tools/parser/pegleromyces/spec/Patterns.test.my.rb +0 -353
  93. data/lib/myco/code_tools/parser/pegleromyces/spec/Processor.test.my +0 -10
  94. data/lib/myco/code_tools/parser/pegleromyces/spec/Processor.test.my.rb +0 -9
  95. data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Parser.test.my +0 -49
  96. data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Parser.test.my.rb +0 -119
  97. data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Patterns.test.my +0 -131
  98. data/lib/myco/code_tools/parser/pegleromyces/spec/Stream/Patterns.test.my.rb +0 -595
  99. data/lib/myco/code_tools/parser/pegleromyces/spec/String/Parser.test.my +0 -120
  100. data/lib/myco/code_tools/parser/pegleromyces/spec/String/Parser.test.my.rb +0 -350
  101. data/lib/myco/code_tools/parser/pegleromyces/spec/run.my +0 -14
  102. 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(:string, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
8
- declare_meme(:error_row, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
9
- declare_meme(:error_col, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
10
- declare_meme(:raise_error, [], nil, ::Myco.cscope.dup) { |*| (::Myco.branch_op(:"&&", self.error_idx) {self.raise(
11
- ::Myco.find_constant(:SyntaxError),
12
- "Unexpected character with parser: #{self.rule} near line: #{self.error_row}, column: #{self.error_col}.\n#{self.string.each_line.to_a.__send__(
13
- :[],
14
- self.error_row.__send__(
15
- :-,
16
- 1
17
- )
18
- )}#{" ".__send__(
19
- :*,
20
- [
21
- self.error_col.__send__(
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
- 0
26
- ].max
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(:parse, [], nil, ::Myco.cscope.dup) { |string, rule:"root", start_idx:0| (
32
- worker = self.new_worker
33
- processor = self.new_processor
34
- state = ::Myco.find_constant(:State).new({
35
- :string => string.to_s,
36
- :rule => rule.to_sym,
37
- :start_idx => start_idx.to_i
38
- })
39
- state.__send__(
40
- :end_idx=,
41
- worker.__send__(
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
- :error_col=,
79
- pos.last
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
- state
83
- )}
103
+ )
84
104
  )}}
85
105
  .tap { |__c__| __c__.__name__ = :Parser })})}}.instance
@@ -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(:"tools/BasicCommand.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
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(:banner, [], nil, ::Myco.cscope.dup) { |*| ("Usage: myco [subcommand] [options] [files]")}
8
- declare_meme(:creation, [[:on, []]], nil, ::Myco.cscope.dup) { |*| (self.run(*::Myco.find_constant(:ARGV)))}
9
- declare_meme(:run, [], nil, ::Myco.cscope.dup) { |*argv| (
10
- files = self.options_parse(*argv)
11
- ::Myco.branch_op(:"&&", files) {files.uniq.each { |file| (::Myco.find_constant(:Myco).eval_file(
12
- file,
13
- [::Myco.find_constant(:Dir).pwd]
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(:"-E", [], nil, ::Myco.cscope.dup) { |*| (::Myco::Component.new([::Myco.find_constant(:Option)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
18
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(
19
- declare_meme(:description, [], nil, ::Myco.cscope.dup) { |*| ("Evaluate a string of declarative Myco")}
20
- declare_meme(:long_form, [], nil, ::Myco.cscope.dup) { |*| ("--eval")}
21
- declare_meme(:argument, [], nil, ::Myco.cscope.dup) { |*| ("STRING")}
22
- declare_meme(:do, [], nil, ::Myco.cscope.dup) { |arg| (::Myco.find_constant(:Myco).eval(arg))}
23
- )}}.instance)}
24
- declare_meme(:"-e", [], nil, ::Myco.cscope.dup) { |*| (::Myco::Component.new([::Myco.find_constant(:Option)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
25
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(
26
- declare_meme(:description, [], nil, ::Myco.cscope.dup) { |*| ("Evaluate a string of procedural Myco inside an Object")}
27
- declare_meme(:long_form, [], nil, ::Myco.cscope.dup) { |*| ("--eval-meme")}
28
- declare_meme(:argument, [], nil, ::Myco.cscope.dup) { |*| ("STRING")}
29
- declare_meme(:do, [], nil, ::Myco.cscope.dup) { |arg| (::Myco.find_constant(:Myco).eval("Object { on creation: { #{arg} } }"))}
30
- )}}.instance)}
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(:inoculate, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Myco).eval_file("command/inoculate.my"))})}
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(:"../tools/BasicCommand.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
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(:banner, [], nil, ::Myco.cscope.dup) { |*| ("Usage: myco inoculate [options]")}
8
- declare_meme(:shell, [], nil, ::Myco.cscope.dup) { |*a, &b| (::Myco.find_constant(:Kernel).instance_method(:system).bind(self).call(
9
- *a,
10
- &b
11
- ))}
12
- declare_meme(:run, [], nil, ::Myco.cscope.dup) { |*argv| (
13
- destinations = self.options_parse(*argv)
14
- ::Myco.branch_op(:"??", ::Myco.branch_op(:"|?", destinations.size.__send__(
15
- :==,
16
- 1
17
- )) {self.show_help}) {destinations.each { |dest| (
18
- self.config.__send__(
19
- :dest=,
20
- dest
21
- )
22
- self.run_operation(
23
- :copy,
24
- self.files(
25
- self.config.source,
26
- "*.md"
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
- self.run_operation(
30
- :copy,
31
- self.files(
32
- self.config.source,
33
- "LICENSE"
37
+ self.run_operation(
38
+ :copy,
39
+ self.files(
40
+ self.config.source,
41
+ "*.md"
42
+ )
34
43
  )
35
- )
36
- self.run_operation(
37
- :copy,
38
- self.files(
39
- self.config.source,
40
- "bin/*"
44
+ self.run_operation(
45
+ :copy,
46
+ self.files(
47
+ self.config.source,
48
+ "LICENSE"
49
+ )
41
50
  )
42
- )
43
- self.run_operation(
44
- :copy,
45
- self.files(
46
- self.config.source,
47
- "lib/**/*.rb"
51
+ self.run_operation(
52
+ :copy,
53
+ self.files(
54
+ self.config.source,
55
+ "bin/*"
56
+ )
48
57
  )
49
- )
50
- self.run_operation(
51
- :copy,
52
- self.files(
53
- self.config.source,
54
- "lib/**/*.my"
58
+ self.run_operation(
59
+ :copy,
60
+ self.files(
61
+ self.config.source,
62
+ "lib/**/*.rb"
63
+ )
55
64
  )
56
- )
57
- self.run_operation(
58
- :myrb,
59
- self.files(
60
- self.config.dest,
61
- "lib/**/*.my"
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
- :if,
66
- self.config.verbose
67
- ) { || (
68
- prog = ::Myco.find_constant(:Rubinius)::Globals.__send__(
69
- :[],
70
- :$PROGRAM_NAME
71
- )
72
- self.puts("DONE #{prog} #{::Myco.find_constant(:ARGV).join(" ")}")
73
- )}
74
- )}}
75
- )}
76
- declare_meme(:run_operation, [], nil, ::Myco.cscope.dup) { |opcode, source_list| (source_list.each { |source| (
77
- dest = self.transforms.send(
78
- opcode,
79
- source
80
- )
81
- self.__send__(
82
- :unless,
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
- self.operations.send(
96
- opcode,
97
- source,
98
- dest
99
- )
100
- )}
101
- )})}
102
- declare_meme(:operation_is_unnecessary, [], nil, ::Myco.cscope.dup) { |source, dest| (::Myco.branch_op(:"&&", ::Myco.find_constant(:File).__send__(
103
- :file?,
104
- dest
105
- )) {::Myco.find_constant(:File).mtime(dest).__send__(
106
- :>=,
107
- ::Myco.find_constant(:File).mtime(source)
108
- )})}
109
- declare_meme(:files, [], nil, ::Myco.cscope.dup) { |prefix, glob| (::Myco.find_constant(:Dir).glob(::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", prefix) {::Myco.find_constant(:File).join(
110
- prefix,
111
- glob
112
- )}) {glob}))}
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(:copy, [], nil, ::Myco.cscope.dup) { |source, dest| (self.shell("mkdir -p #{::Myco.find_constant(:File).dirname(dest)} && cp #{source} #{dest}"))}
115
- declare_meme(:myrb, [], nil, ::Myco.cscope.dup) { |source, dest| (::Myco.find_constant(:Myco)::CodeLoader::MycoLoader.new(source).__send__(:emit_rb!))}
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(:copy, [], nil, ::Myco.cscope.dup) { |filename| (::Myco.find_constant(:File).join(
119
- self.config.dest,
120
- filename
121
- ))}
122
- declare_meme(:myrb, [], nil, ::Myco.cscope.dup) { |filename| ("#{filename}.rb")}
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(:source, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
126
- declare_meme(:dest, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
127
- declare_meme(:verbose, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
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(:"-d", [], nil, ::Myco.cscope.dup) { |*| (::Myco::Component.new([::Myco.find_constant(:Option)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
131
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(
132
- declare_meme(:description, [], nil, ::Myco.cscope.dup) { |*| ("The destination directory to clone material into.")}
133
- declare_meme(:long_form, [], nil, ::Myco.cscope.dup) { |*| ("--dest")}
134
- declare_meme(:argument, [], nil, ::Myco.cscope.dup) { |*| ("STRING")}
135
- declare_meme(:do, [], nil, ::Myco.cscope.dup) { |arg| (self.parent.config.__send__(
136
- :dest=,
137
- arg
138
- ))}
139
- )}}.instance)}
140
- declare_meme(:"-v", [], nil, ::Myco.cscope.dup) { |*| (::Myco::Component.new([::Myco.find_constant(:Option)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
141
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(
142
- declare_meme(:description, [], nil, ::Myco.cscope.dup) { |*| ("Show details about material cloning operations.")}
143
- declare_meme(:long_form, [], nil, ::Myco.cscope.dup) { |*| ("--verbose")}
144
- declare_meme(:do, [], nil, ::Myco.cscope.dup) { |arg| (self.parent.config.__send__(
145
- :verbose=,
146
- true
147
- ))}
148
- )}}.instance)}
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