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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10d6d42881d428ea5359f83d8bfdce81ebf34ea7
4
- data.tar.gz: fa2936dff1fbf455e7b8462c1c969cc023de020b
3
+ metadata.gz: 6ee9e5cedec16c7d921644a998eec8c6ee901443
4
+ data.tar.gz: c94e691503c0b83682e51a292f9bee7007be22c1
5
5
  SHA512:
6
- metadata.gz: 9663e17bf43f6b64241939eafeb51350bb6a7298add9322c815f4ed4dec266efa93398ad4c27243bdfd20524a314c6cc8a0eaf6f8f3016dc807660df07bd65e5
7
- data.tar.gz: da1ebe5deab665ceef785c9ddb89cb62fd6e551d616c8bbacb0af15fd590cdaf32a10597d051dab58fc4476290003dde6bcda25f9fcbc3ed8b27479dfe7b515d
6
+ metadata.gz: 1296828e31cb12b25fc17bee1d92e6922e5a0767e1347bcf374a00975d35652d0ef081967e29f6fa90fbcf7c9e6e279df3f6c6bf23b71f4dc362ef50d78251fc
7
+ data.tar.gz: d8cd85ae93f67d7670fd4cfb7b52a0e56a609f777c5ac33f1a03797c9b7a2055edea6a6b7e286b340a824d4396307f9a46be5c5ad41d93a574a202966ccef964
@@ -2,10 +2,14 @@
2
2
  ::Myco::Component.new([::Myco::FileToplevel], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
3
3
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(
4
4
  ::Myco::RubyEval = ::Myco::Component.new([::Myco::EmptyObject], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
5
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:from_string, [], nil, ::Myco.cscope.dup) { |string| (::Object.__send__(
6
- :eval,
7
- string
8
- ))})}}
5
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
6
+ :from_string,
7
+ [],
8
+ ::Object::Proc.new { |string| (::Object.__send__(
9
+ :eval,
10
+ string
11
+ ))}
12
+ ))}}
9
13
  .tap { |__c__| __c__.__name__ = :RubyEval }
10
14
  ::Myco::Category = ::Myco::Component.new([::Myco::EmptyObject], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
11
15
  .tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
@@ -26,21 +30,53 @@
26
30
  .tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
27
31
  .tap { |__c__| __c__.__name__ = :FileToplevel }
28
32
  __category__(:decorators).component_eval {(
29
- declare_meme(:load, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:LoadDecorator))}
33
+ declare_meme(
34
+ :load,
35
+ [],
36
+ ::Object::Proc.new { |*| (::Myco.find_constant(:LoadDecorator))}
37
+ )
30
38
  ::Myco.cscope.for_method_definition::LoadDecorator = (::Myco::Component.new([::Myco::Decorator], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
31
39
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(
32
- declare_meme(:apply, [], nil, ::Myco.cscope.dup) { |meme| (::Myco.eval_file(
33
- meme.name.to_s,
34
- [::Myco::CoreLoadPath]
40
+ declare_meme(
41
+ :apply,
42
+ [],
43
+ ::Object::Proc.new { |meme| (::Myco.eval_file(
44
+ meme.name.to_s,
45
+ [::Myco::CoreLoadPath]
46
+ ))}
47
+ )
48
+ __category__(:transforms).component_eval {(declare_meme(
49
+ :apply,
50
+ [],
51
+ ::Object::Proc.new { |*| nil}
35
52
  ))}
36
- __category__(:transforms).component_eval {(declare_meme(:apply, [], nil, ::Myco.cscope.dup) { |*| nil})}
37
53
  )}}.instance)
38
54
  )}
39
55
  __category__(:main).component_eval {(
40
- declare_meme(:"core/Category.my", [[:load, []]], nil, ::Myco.cscope.dup) { |*| nil}
41
- declare_meme(:"core/Decorator.my", [[:load, []]], nil, ::Myco.cscope.dup) { |*| nil}
42
- declare_meme(:"core/BasicDecorators.my", [[:load, []]], nil, ::Myco.cscope.dup) { |*| nil}
43
- declare_meme(:"core/BasicObject.my", [[:load, []]], nil, ::Myco.cscope.dup) { |*| nil}
44
- declare_meme(:"core/FileToplevel.my", [[:load, []]], nil, ::Myco.cscope.dup) { |*| nil}
56
+ declare_meme(
57
+ :"core/Category.my",
58
+ [:load],
59
+ ::Object::Proc.new { |*| nil}
60
+ )
61
+ declare_meme(
62
+ :"core/Decorator.my",
63
+ [:load],
64
+ ::Object::Proc.new { |*| nil}
65
+ )
66
+ declare_meme(
67
+ :"core/BasicDecorators.my",
68
+ [:load],
69
+ ::Object::Proc.new { |*| nil}
70
+ )
71
+ declare_meme(
72
+ :"core/BasicObject.my",
73
+ [:load],
74
+ ::Object::Proc.new { |*| nil}
75
+ )
76
+ declare_meme(
77
+ :"core/FileToplevel.my",
78
+ [:load],
79
+ ::Object::Proc.new { |*| nil}
80
+ )
45
81
  )}
46
82
  )}}.instance
@@ -3,8 +3,8 @@ module Myco
3
3
  # In Myco, try to always use Myco.add_method instead of Rubinius.add_method
4
4
  # to bypass all of the Ruby-specific logic therein.
5
5
 
6
- def self.add_method mod, name, executable
7
- mod.method_table.store(name, executable, :public)
6
+ def self.add_method mod, name, executable, cscope
7
+ mod.method_table.store(name, nil, executable, cscope, 0, :public)
8
8
  Rubinius::VM.reset_method_cache(mod, name)
9
9
  end
10
10
 
@@ -14,7 +14,7 @@ module Myco
14
14
 
15
15
  # Use instead of Module#thunk_method
16
16
  def self.add_thunk_method mod, name, value
17
- add_method(mod, name, Rubinius::Thunk.new(value))
17
+ add_method(mod, name, Rubinius::Thunk.new(value), nil)
18
18
  end
19
19
 
20
20
  # Use instead of Module#dynamic_method
@@ -31,8 +31,8 @@ module Myco
31
31
  g.encode
32
32
 
33
33
  code = g.package Rubinius::CompiledCode
34
- code.scope = Rubinius::ConstantScope.new(mod, Rubinius::ConstantScope.new(Myco))
34
+ cscope = Rubinius::ConstantScope.new(mod, Rubinius::ConstantScope.new(Myco))
35
35
 
36
- add_method(mod, name, code)
36
+ add_method(mod, name, code, cscope)
37
37
  end
38
38
  end
@@ -152,7 +152,8 @@ module Myco
152
152
  bind_cache_method
153
153
  @effective_body = @target.instance_method(@name).executable
154
154
  else
155
- Myco.add_method(@target, @name, @body)
155
+ cscope = @body.respond_to?(:scope) ? @body.scope : nil
156
+ Myco.add_method(@target, @name, @body, cscope)
156
157
  end
157
158
  end
158
159
 
@@ -2,7 +2,7 @@
2
2
  ::Myco::Component.new([::Myco::FileToplevel], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
3
3
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(
4
4
  ::Myco.find_constant(:CodeTools)::AST.component_eval {(
5
- ::Myco.cscope.for_method_definition::BuilderMethods = (::Myco.find_constant(:Module).new { || nil})
5
+ ::Myco.cscope.for_method_definition::BuilderMethods = (::Myco.find_constant(:Module).new { |*| nil})
6
6
  ::Myco.cscope.for_method_definition::Builder = ::Myco::Component.new([
7
7
  ::Myco.find_constant(:BasicObject),
8
8
  ::Myco.find_constant(:BuilderMethods)
@@ -10,46 +10,214 @@
10
10
  .tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
11
11
  .tap { |__c__| __c__.__name__ = :Builder }
12
12
  )}
13
- declare_meme(:"AST/Node.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
14
- declare_meme(:"AST/Script.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
15
- declare_meme(:"AST/NumericLiteral.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
16
- declare_meme(:"AST/StringLiteral.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
17
- declare_meme(:"AST/SymbolLiteral.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
18
- declare_meme(:"AST/StringCompose.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
19
- declare_meme(:"AST/SymbolCompose.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
20
- declare_meme(:"AST/Sequence.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
21
- declare_meme(:"AST/SplatValue.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
22
- declare_meme(:"AST/ArrayAssembly.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
23
- declare_meme(:"AST/KeywordAssembly.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
24
- declare_meme(:"AST/ArgumentAssembly.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
25
- declare_meme(:"AST/BlockArgument.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
26
- declare_meme(:"AST/Block.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
27
- declare_meme(:"AST/RequiredParameter.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
28
- declare_meme(:"AST/OptionalParameter.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
29
- declare_meme(:"AST/RestParameter.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
30
- declare_meme(:"AST/KeywordRequiredParameter.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
31
- declare_meme(:"AST/KeywordOptionalParameter.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
32
- declare_meme(:"AST/KeywordRestParameter.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
33
- declare_meme(:"AST/BlockParameter.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
34
- declare_meme(:"AST/ParameterAssembly.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
35
- declare_meme(:"AST/BlockLiteral.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
36
- declare_meme(:"AST/ConstantAccess.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
37
- declare_meme(:"AST/ConstantAssignment.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
38
- declare_meme(:"AST/ConstantDefine.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
39
- declare_meme(:"AST/DeclaredScope.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
40
- declare_meme(:"AST/DeclareObject.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
41
- declare_meme(:"AST/DeclareString.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
42
- declare_meme(:"AST/DeclareFile.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
43
- declare_meme(:"AST/DeclareExtension.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
44
- declare_meme(:"AST/DeclareCategory.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
45
- declare_meme(:"AST/DeclareMeme.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
46
- declare_meme(:"AST/Invoke.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
47
- declare_meme(:"AST/InvokeMethod.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
48
- declare_meme(:"AST/LocalVariableAccessAmbiguous.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
49
- declare_meme(:"AST/LocalVariableAssignment.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
50
- declare_meme(:"AST/Quest.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
51
- declare_meme(:"AST/BranchOperator.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
52
- declare_meme(:"AST/PipeOperator.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
53
- declare_meme(:"AST/misc.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
54
- declare_meme(:"AST/ToRuby.my", [[:import, []]], nil, ::Myco.cscope.dup) { |*| nil}
13
+ declare_meme(
14
+ :"AST/Node.my",
15
+ [:import],
16
+ ::Object::Proc.new { |*| nil}
17
+ )
18
+ declare_meme(
19
+ :"AST/Script.my",
20
+ [:import],
21
+ ::Object::Proc.new { |*| nil}
22
+ )
23
+ declare_meme(
24
+ :"AST/NumericLiteral.my",
25
+ [:import],
26
+ ::Object::Proc.new { |*| nil}
27
+ )
28
+ declare_meme(
29
+ :"AST/StringLiteral.my",
30
+ [:import],
31
+ ::Object::Proc.new { |*| nil}
32
+ )
33
+ declare_meme(
34
+ :"AST/SymbolLiteral.my",
35
+ [:import],
36
+ ::Object::Proc.new { |*| nil}
37
+ )
38
+ declare_meme(
39
+ :"AST/StringCompose.my",
40
+ [:import],
41
+ ::Object::Proc.new { |*| nil}
42
+ )
43
+ declare_meme(
44
+ :"AST/SymbolCompose.my",
45
+ [:import],
46
+ ::Object::Proc.new { |*| nil}
47
+ )
48
+ declare_meme(
49
+ :"AST/Sequence.my",
50
+ [:import],
51
+ ::Object::Proc.new { |*| nil}
52
+ )
53
+ declare_meme(
54
+ :"AST/SplatValue.my",
55
+ [:import],
56
+ ::Object::Proc.new { |*| nil}
57
+ )
58
+ declare_meme(
59
+ :"AST/ArrayAssembly.my",
60
+ [:import],
61
+ ::Object::Proc.new { |*| nil}
62
+ )
63
+ declare_meme(
64
+ :"AST/KeywordAssembly.my",
65
+ [:import],
66
+ ::Object::Proc.new { |*| nil}
67
+ )
68
+ declare_meme(
69
+ :"AST/ArgumentAssembly.my",
70
+ [:import],
71
+ ::Object::Proc.new { |*| nil}
72
+ )
73
+ declare_meme(
74
+ :"AST/BlockArgument.my",
75
+ [:import],
76
+ ::Object::Proc.new { |*| nil}
77
+ )
78
+ declare_meme(
79
+ :"AST/Block.my",
80
+ [:import],
81
+ ::Object::Proc.new { |*| nil}
82
+ )
83
+ declare_meme(
84
+ :"AST/RequiredParameter.my",
85
+ [:import],
86
+ ::Object::Proc.new { |*| nil}
87
+ )
88
+ declare_meme(
89
+ :"AST/OptionalParameter.my",
90
+ [:import],
91
+ ::Object::Proc.new { |*| nil}
92
+ )
93
+ declare_meme(
94
+ :"AST/RestParameter.my",
95
+ [:import],
96
+ ::Object::Proc.new { |*| nil}
97
+ )
98
+ declare_meme(
99
+ :"AST/KeywordRequiredParameter.my",
100
+ [:import],
101
+ ::Object::Proc.new { |*| nil}
102
+ )
103
+ declare_meme(
104
+ :"AST/KeywordOptionalParameter.my",
105
+ [:import],
106
+ ::Object::Proc.new { |*| nil}
107
+ )
108
+ declare_meme(
109
+ :"AST/KeywordRestParameter.my",
110
+ [:import],
111
+ ::Object::Proc.new { |*| nil}
112
+ )
113
+ declare_meme(
114
+ :"AST/BlockParameter.my",
115
+ [:import],
116
+ ::Object::Proc.new { |*| nil}
117
+ )
118
+ declare_meme(
119
+ :"AST/ParameterAssembly.my",
120
+ [:import],
121
+ ::Object::Proc.new { |*| nil}
122
+ )
123
+ declare_meme(
124
+ :"AST/BlockLiteral.my",
125
+ [:import],
126
+ ::Object::Proc.new { |*| nil}
127
+ )
128
+ declare_meme(
129
+ :"AST/ConstantAccess.my",
130
+ [:import],
131
+ ::Object::Proc.new { |*| nil}
132
+ )
133
+ declare_meme(
134
+ :"AST/ConstantAssignment.my",
135
+ [:import],
136
+ ::Object::Proc.new { |*| nil}
137
+ )
138
+ declare_meme(
139
+ :"AST/ConstantDefine.my",
140
+ [:import],
141
+ ::Object::Proc.new { |*| nil}
142
+ )
143
+ declare_meme(
144
+ :"AST/DeclaredScope.my",
145
+ [:import],
146
+ ::Object::Proc.new { |*| nil}
147
+ )
148
+ declare_meme(
149
+ :"AST/DeclareObject.my",
150
+ [:import],
151
+ ::Object::Proc.new { |*| nil}
152
+ )
153
+ declare_meme(
154
+ :"AST/DeclareString.my",
155
+ [:import],
156
+ ::Object::Proc.new { |*| nil}
157
+ )
158
+ declare_meme(
159
+ :"AST/DeclareFile.my",
160
+ [:import],
161
+ ::Object::Proc.new { |*| nil}
162
+ )
163
+ declare_meme(
164
+ :"AST/DeclareExtension.my",
165
+ [:import],
166
+ ::Object::Proc.new { |*| nil}
167
+ )
168
+ declare_meme(
169
+ :"AST/DeclareCategory.my",
170
+ [:import],
171
+ ::Object::Proc.new { |*| nil}
172
+ )
173
+ declare_meme(
174
+ :"AST/DeclareMeme.my",
175
+ [:import],
176
+ ::Object::Proc.new { |*| nil}
177
+ )
178
+ declare_meme(
179
+ :"AST/Invoke.my",
180
+ [:import],
181
+ ::Object::Proc.new { |*| nil}
182
+ )
183
+ declare_meme(
184
+ :"AST/InvokeMethod.my",
185
+ [:import],
186
+ ::Object::Proc.new { |*| nil}
187
+ )
188
+ declare_meme(
189
+ :"AST/LocalVariableAccessAmbiguous.my",
190
+ [:import],
191
+ ::Object::Proc.new { |*| nil}
192
+ )
193
+ declare_meme(
194
+ :"AST/LocalVariableAssignment.my",
195
+ [:import],
196
+ ::Object::Proc.new { |*| nil}
197
+ )
198
+ declare_meme(
199
+ :"AST/Quest.my",
200
+ [:import],
201
+ ::Object::Proc.new { |*| nil}
202
+ )
203
+ declare_meme(
204
+ :"AST/BranchOperator.my",
205
+ [:import],
206
+ ::Object::Proc.new { |*| nil}
207
+ )
208
+ declare_meme(
209
+ :"AST/PipeOperator.my",
210
+ [:import],
211
+ ::Object::Proc.new { |*| nil}
212
+ )
213
+ declare_meme(
214
+ :"AST/misc.my",
215
+ [:import],
216
+ ::Object::Proc.new { |*| nil}
217
+ )
218
+ declare_meme(
219
+ :"AST/ToRuby.my",
220
+ [:import],
221
+ ::Object::Proc.new { |*| nil}
222
+ )
55
223
  )}}.instance
@@ -2,57 +2,101 @@
2
2
  ::Myco::Component.new([::Myco::FileToplevel], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
3
3
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(::Myco.find_constant(:CodeTools)::AST.component_eval {(::Myco.cscope.for_method_definition::ArgumentAssembly = ::Myco::Component.new([::Myco.find_constant(:Node)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
4
4
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(
5
- declare_meme(:args, [[:node_type, []]], nil, ::Myco.cscope.dup) { |*| nil}
6
- declare_meme(:body, [[:field, []]], nil, ::Myco.cscope.dup) { |*| nil}
7
- declare_meme(:block, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
8
- declare_meme(:body, [[:setter, []]], nil, ::Myco.cscope.dup) { |given_body| (
9
- ::Myco.branch_op(:"&&", given_body.last.__send__(
10
- :is_a?,
11
- ::Myco.find_constant(:BlockArgument)
12
- )) {self.__send__(
13
- :block=,
14
- given_body.pop
5
+ declare_meme(
6
+ :args,
7
+ [:node_type],
8
+ ::Object::Proc.new { |*| nil}
9
+ )
10
+ declare_meme(
11
+ :body,
12
+ [:field],
13
+ ::Object::Proc.new { |*| nil}
14
+ )
15
+ declare_meme(
16
+ :block,
17
+ [:var],
18
+ ::Object::Proc.new { |*| nil}
19
+ )
20
+ declare_meme(
21
+ :body,
22
+ [:setter],
23
+ ::Object::Proc.new { |given_body| (
24
+ ::Myco.branch_op(:"&&", given_body.last.__send__(
25
+ :is_a?,
26
+ ::Myco.find_constant(:BlockArgument)
27
+ )) {self.__send__(
28
+ :block=,
29
+ given_body.pop
30
+ )}
31
+ given_body
15
32
  )}
16
- given_body
17
- )}
18
- declare_meme(:pre_group, [], nil, ::Myco.cscope.dup) { |*| (self.body.take_while { |item| (item.__send__(
19
- :is_a?,
20
- ::Myco.find_constant(:SplatValue)
21
- ).__send__(:!))})}
22
- declare_meme(:post_group, [], nil, ::Myco.cscope.dup) { |*| (self.body.drop_while { |item| (item.__send__(
23
- :is_a?,
24
- ::Myco.find_constant(:SplatValue)
25
- ).__send__(:!))})}
26
- declare_meme(:send_op, [], nil, ::Myco.cscope.dup) { |*| (self.cond(
27
- self.body.detect { |item| (item.__send__(
33
+ )
34
+ declare_meme(
35
+ :pre_group,
36
+ [],
37
+ ::Object::Proc.new { |*| (self.body.take_while { |item| (item.__send__(
38
+ :is_a?,
39
+ ::Myco.find_constant(:SplatValue)
40
+ ).__send__(:!))})}
41
+ )
42
+ declare_meme(
43
+ :post_group,
44
+ [],
45
+ ::Object::Proc.new { |*| (self.body.drop_while { |item| (item.__send__(
28
46
  :is_a?,
29
47
  ::Myco.find_constant(:SplatValue)
30
- ))},
31
- :send_with_splat,
32
- self.block,
33
- :send_with_block,
34
- :send
35
- ))}
36
- declare_meme(:send_count, [], nil, ::Myco.cscope.dup) { |*| (self.pre_group.size)}
37
- declare_meme(:splat_bytecode, [], nil, ::Myco.cscope.dup) { |g| (::Myco.find_constant(:ArrayAssembly).new({
38
- :line => self.line,
39
- :body => self.post_group
40
- }).bytecode(g))}
41
- declare_meme(:block_bytecode, [], nil, ::Myco.cscope.dup) { |g| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.block) {self.block.bytecode(g)}) {g.push_null})}
42
- declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
43
- self.pos(g)
44
- self.pre_group.each { |item| (item.bytecode(g))}
45
- ::Myco.branch_op(:"&&", self.send_op.__send__(
46
- :==,
47
- :send_with_splat
48
- )) {(
49
- self.splat_bytecode(g)
50
- self.block_bytecode(g)
48
+ ).__send__(:!))})}
49
+ )
50
+ declare_meme(
51
+ :send_op,
52
+ [],
53
+ ::Object::Proc.new { |*| (self.cond(
54
+ self.body.detect { |item| (item.__send__(
55
+ :is_a?,
56
+ ::Myco.find_constant(:SplatValue)
57
+ ))},
58
+ :send_with_splat,
59
+ self.block,
60
+ :send_with_block,
61
+ :send
62
+ ))}
63
+ )
64
+ declare_meme(
65
+ :send_count,
66
+ [],
67
+ ::Object::Proc.new { |*| (self.pre_group.size)}
68
+ )
69
+ declare_meme(
70
+ :splat_bytecode,
71
+ [],
72
+ ::Object::Proc.new { |g| (::Myco.find_constant(:ArrayAssembly).new({
73
+ :line => self.line,
74
+ :body => self.post_group
75
+ }).bytecode(g))}
76
+ )
77
+ declare_meme(
78
+ :block_bytecode,
79
+ [],
80
+ ::Object::Proc.new { |g| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.block) {self.block.bytecode(g)}) {g.push_null})}
81
+ )
82
+ declare_meme(
83
+ :bytecode,
84
+ [],
85
+ ::Object::Proc.new { |g| (
86
+ self.pos(g)
87
+ self.pre_group.each { |item| (item.bytecode(g))}
88
+ ::Myco.branch_op(:"&&", self.send_op.__send__(
89
+ :==,
90
+ :send_with_splat
91
+ )) {(
92
+ self.splat_bytecode(g)
93
+ self.block_bytecode(g)
94
+ )}
95
+ ::Myco.branch_op(:"&&", self.send_op.__send__(
96
+ :==,
97
+ :send_with_block
98
+ )) {self.block_bytecode(g)}
51
99
  )}
52
- ::Myco.branch_op(:"&&", self.send_op.__send__(
53
- :==,
54
- :send_with_block
55
- )) {self.block_bytecode(g)}
56
- )}
100
+ )
57
101
  )}}
58
102
  .tap { |__c__| __c__.__name__ = :ArgumentAssembly })})}}.instance