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
@@ -2,33 +2,45 @@
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::ArrayAssembly = ::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(:array, [[:node_type, []]], nil, ::Myco.cscope.dup) { |*| nil}
6
- declare_meme(:body, [[:field, []]], nil, ::Myco.cscope.dup) { |*| nil}
7
- declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
8
- self.pos(g)
9
- ::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.body.__send__(:empty?)) {g.make_array(0)}) {(
10
- chunked = self.body.chunk { |item| (item.__send__(
11
- :is_a?,
12
- ::Myco.find_constant(:SplatValue)
13
- ))}
14
- first_bytecode = true
15
- chunked.each { |is_splat_group, group| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", is_splat_group) {group.each { |item| (
16
- item.bytecode(g)
17
- ::Myco.branch_op(:"||", first_bytecode) {g.send(
18
- :concat,
19
- 1
20
- )}
21
- first_bytecode = false
22
- )}}) {(
23
- group.each { |item| (item.bytecode(g))}
24
- g.make_array(group.size)
25
- ::Myco.branch_op(:"||", first_bytecode) {g.send(
26
- :concat,
27
- 1
28
- )}
29
- first_bytecode = false
30
- )})}
5
+ declare_meme(
6
+ :array,
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
+ :bytecode,
17
+ [],
18
+ ::Object::Proc.new { |g| (
19
+ self.pos(g)
20
+ ::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.body.__send__(:empty?)) {g.make_array(0)}) {(
21
+ chunked = self.body.chunk { |item| (item.__send__(
22
+ :is_a?,
23
+ ::Myco.find_constant(:SplatValue)
24
+ ))}
25
+ first_bytecode = true
26
+ chunked.each { |is_splat_group, group| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", is_splat_group) {group.each { |item| (
27
+ item.bytecode(g)
28
+ ::Myco.branch_op(:"||", first_bytecode) {g.send(
29
+ :concat,
30
+ 1
31
+ )}
32
+ first_bytecode = false
33
+ )}}) {(
34
+ group.each { |item| (item.bytecode(g))}
35
+ g.make_array(group.size)
36
+ ::Myco.branch_op(:"||", first_bytecode) {g.send(
37
+ :concat,
38
+ 1
39
+ )}
40
+ first_bytecode = false
41
+ )})}
42
+ )}
31
43
  )}
32
- )}
44
+ )
33
45
  )}}
34
46
  .tap { |__c__| __c__.__name__ = :ArrayAssembly })})}}.instance
@@ -5,51 +5,73 @@
5
5
  ::Myco.find_constant(:Node)
6
6
  ], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
7
7
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(
8
- declare_meme(:block, [[:node_type, []]], nil, ::Myco.cscope.dup) { |*| nil}
9
- declare_meme(:parameters, [[:field, []]], nil, ::Myco.cscope.dup) { |*| nil}
10
- declare_meme(:body, [[:field, []]], nil, ::Myco.cscope.dup) { |*| nil}
11
- declare_meme(:parent, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
12
- declare_meme(:new_cscope, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
8
+ declare_meme(
9
+ :block,
10
+ [:node_type],
11
+ ::Object::Proc.new { |*| nil}
12
+ )
13
+ declare_meme(
14
+ :parameters,
15
+ [:field],
16
+ ::Object::Proc.new { |*| nil}
17
+ )
18
+ declare_meme(
19
+ :body,
20
+ [:field],
21
+ ::Object::Proc.new { |*| nil}
22
+ )
23
+ declare_meme(
24
+ :parent,
25
+ [:var],
26
+ ::Object::Proc.new { |*| nil}
27
+ )
28
+ declare_meme(
29
+ :new_cscope,
30
+ [:var],
31
+ ::Object::Proc.new { |*| nil}
32
+ )
13
33
  ::Myco.cscope.for_method_definition::CompilerClass = (::Myco.find_constant(:CodeTools)::Compiler)
14
- declare_meme(:body, [[:setter, []]], nil, ::Myco.cscope.dup) { |given| (::Myco.branch_op(:"||", given) {::Myco.find_constant(:NullLiteral).new({:line => self.line})})}
15
- declare_meme(:locals, [], nil, ::Myco.cscope.dup) { |*| (::Myco.branch_op(:"??", (Rubinius::Type.object_respond_to?((Rubinius::Type.object_respond_to?(self.body, :locals).false? ? ::Myco::Void : self.body.locals), :body).false? ? ::Myco::Void : (Rubinius::Type.object_respond_to?(self.body, :locals).false? ? ::Myco::Void : self.body.locals).body).map(&:value)) {nil})}
16
- declare_meme(:block_local?, [], nil, ::Myco.cscope.dup) { |name| (::Myco.branch_op(:"??", (Rubinius::Type.object_respond_to?(self.locals, :include?).false? ? ::Myco::Void : self.locals.__send__(
17
- :include?,
18
- name
19
- ))) {false})}
20
- declare_meme(:module?, [], nil, ::Myco.cscope.dup) { |*| (false)}
21
- declare_meme(:nest_scope, [], nil, ::Myco.cscope.dup) { |scope| (scope.__send__(
22
- :parent=,
23
- self
24
- ))}
25
- declare_meme(:search_local, [], nil, ::Myco.cscope.dup) { |name| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", variable = self.variables.__send__(
26
- :[],
27
- name
28
- )) {variable.nested_reference}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.__send__(
34
+ declare_meme(
35
+ :body,
36
+ [:setter],
37
+ ::Object::Proc.new { |given| (::Myco.branch_op(:"||", given) {::Myco.find_constant(:NullLiteral).new({:line => self.line})})}
38
+ )
39
+ declare_meme(
40
+ :locals,
41
+ [],
42
+ ::Object::Proc.new { |*| (::Myco.branch_op(:"??", (Rubinius::Type.object_respond_to?((Rubinius::Type.object_respond_to?(self.body, :locals).false? ? ::Myco::Void : self.body.locals), :body).false? ? ::Myco::Void : (Rubinius::Type.object_respond_to?(self.body, :locals).false? ? ::Myco::Void : self.body.locals).body).map(&:value)) {nil})}
43
+ )
44
+ declare_meme(
29
45
  :block_local?,
30
- name
31
- )) {self.new_local(name)}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", reference = self.parent.search_local(name)) {(
32
- reference.__send__(
33
- :depth=,
34
- reference.depth.__send__(
35
- :+,
36
- 1
37
- )
38
- )
39
- reference
40
- )}) {nil}}})}
41
- declare_meme(:assign_local_reference, [], nil, ::Myco.cscope.dup) { |var| (var.__send__(
42
- :variable=,
43
- ::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", variable = self.variables.__send__(
46
+ [],
47
+ ::Object::Proc.new { |name| (::Myco.branch_op(:"??", (Rubinius::Type.object_respond_to?(self.locals, :include?).false? ? ::Myco::Void : self.locals.__send__(
48
+ :include?,
49
+ name
50
+ ))) {false})}
51
+ )
52
+ declare_meme(
53
+ :module?,
54
+ [],
55
+ ::Object::Proc.new { |*| (false)}
56
+ )
57
+ declare_meme(
58
+ :nest_scope,
59
+ [],
60
+ ::Object::Proc.new { |scope| (scope.__send__(
61
+ :parent=,
62
+ self
63
+ ))}
64
+ )
65
+ declare_meme(
66
+ :search_local,
67
+ [],
68
+ ::Object::Proc.new { |name| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", variable = self.variables.__send__(
44
69
  :[],
45
- var.name
46
- )) {variable.reference}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.__send__(
70
+ name
71
+ )) {variable.nested_reference}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.__send__(
47
72
  :block_local?,
48
- var.name
49
- )) {(
50
- variable = self.new_local(var.name)
51
- variable.reference
52
- )}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", reference = self.parent.search_local(var.name)) {(
73
+ name
74
+ )) {self.new_local(name)}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", reference = self.parent.search_local(name)) {(
53
75
  reference.__send__(
54
76
  :depth=,
55
77
  reference.depth.__send__(
@@ -58,78 +80,120 @@
58
80
  )
59
81
  )
60
82
  reference
61
- )}) {(
62
- variable = self.new_local(var.name)
63
- variable.reference
64
- )}}}
65
- ))}
66
- declare_meme(:new_local, [], nil, ::Myco.cscope.dup) { |name| (self.variables.__send__(
67
- :[]=,
68
- name,
69
- ::Myco.branch_op(:"||", self.variables.__send__(
70
- :[],
71
- name
72
- )) {::Myco.find_constant(:CompilerClass)::LocalVariable.new(self.allocate_slot)}
73
- ))}
74
- declare_meme(:new_nested_local, [], nil, ::Myco.cscope.dup) { |name| (self.new_local(name).nested_reference)}
75
- declare_meme(:effective_parameters, [], nil, ::Myco.cscope.dup) { |*| (::Myco.branch_op(:"||", self.parameters) {::Myco.find_constant(:ParameterAssembly).new({
76
- :line => self.line,
77
- :rest => ::Myco.find_constant(:RestParameter).new({:line => self.line})
78
- })})}
79
- declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
80
- self.pos(g)
81
- state = g.state
82
- state.scope.nest_scope(self)
83
- parameters = self.effective_parameters
84
- blk = self.new_block_generator(
85
- g,
86
- parameters
87
- )
88
- blk.push_state(self)
89
- blk.definition_line(self.line)
90
- blk.state.push_super(state.super)
91
- blk.state.push_eval(state.eval)
92
- blk.state.push_name(blk.name)
93
- self.pos(blk)
94
- parameters.bytecode(blk)
95
- blk.state.push_block
96
- blk.push_modifiers
97
- blk.__send__(
98
- :break=,
99
- nil
100
- )
101
- blk.__send__(
102
- :next=,
103
- nil
104
- )
105
- blk.__send__(
106
- :redo=,
107
- blk.new_label
108
- )
109
- blk.redo.__send__(:set!)
110
- self.body.bytecode(blk)
111
- blk.pop_modifiers
112
- blk.state.pop_block
113
- blk.ret
114
- blk.close
115
- blk.pop_state
116
- blk.__send__(
117
- :local_count=,
118
- self.local_count
119
- )
120
- blk.__send__(
121
- :local_names=,
122
- self.local_names
123
- )
124
- ::Myco.branch_op(:"&?", self.new_cscope) {(
125
- g.push_scope
126
- g.send(
127
- :for_method_definition,
128
- 0
83
+ )}) {nil}}})}
84
+ )
85
+ declare_meme(
86
+ :assign_local_reference,
87
+ [],
88
+ ::Object::Proc.new { |var| (var.__send__(
89
+ :variable=,
90
+ ::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", variable = self.variables.__send__(
91
+ :[],
92
+ var.name
93
+ )) {variable.reference}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", self.__send__(
94
+ :block_local?,
95
+ var.name
96
+ )) {(
97
+ variable = self.new_local(var.name)
98
+ variable.reference
99
+ )}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", reference = self.parent.search_local(var.name)) {(
100
+ reference.__send__(
101
+ :depth=,
102
+ reference.depth.__send__(
103
+ :+,
104
+ 1
105
+ )
106
+ )
107
+ reference
108
+ )}) {(
109
+ variable = self.new_local(var.name)
110
+ variable.reference
111
+ )}}}
112
+ ))}
113
+ )
114
+ declare_meme(
115
+ :new_local,
116
+ [],
117
+ ::Object::Proc.new { |name| (self.variables.__send__(
118
+ :[]=,
119
+ name,
120
+ ::Myco.branch_op(:"||", self.variables.__send__(
121
+ :[],
122
+ name
123
+ )) {::Myco.find_constant(:CompilerClass)::LocalVariable.new(self.allocate_slot)}
124
+ ))}
125
+ )
126
+ declare_meme(
127
+ :new_nested_local,
128
+ [],
129
+ ::Object::Proc.new { |name| (self.new_local(name).nested_reference)}
130
+ )
131
+ declare_meme(
132
+ :effective_parameters,
133
+ [],
134
+ ::Object::Proc.new { |*| (::Myco.branch_op(:"||", self.parameters) {::Myco.find_constant(:ParameterAssembly).new({
135
+ :line => self.line,
136
+ :rest => ::Myco.find_constant(:RestParameter).new({:line => self.line})
137
+ })})}
138
+ )
139
+ declare_meme(
140
+ :bytecode,
141
+ [],
142
+ ::Object::Proc.new { |g| (
143
+ self.pos(g)
144
+ state = g.state
145
+ state.scope.nest_scope(self)
146
+ parameters = self.effective_parameters
147
+ blk = self.new_block_generator(
148
+ g,
149
+ parameters
129
150
  )
130
- g.add_scope
151
+ blk.push_state(self)
152
+ blk.definition_line(self.line)
153
+ blk.state.push_super(state.super)
154
+ blk.state.push_eval(state.eval)
155
+ blk.state.push_name(blk.name)
156
+ self.pos(blk)
157
+ parameters.bytecode(blk)
158
+ blk.state.push_block
159
+ blk.push_modifiers
160
+ blk.__send__(
161
+ :break=,
162
+ nil
163
+ )
164
+ blk.__send__(
165
+ :next=,
166
+ nil
167
+ )
168
+ blk.__send__(
169
+ :redo=,
170
+ blk.new_label
171
+ )
172
+ blk.redo.__send__(:set!)
173
+ self.body.bytecode(blk)
174
+ blk.pop_modifiers
175
+ blk.state.pop_block
176
+ blk.ret
177
+ blk.close
178
+ blk.pop_state
179
+ blk.__send__(
180
+ :local_count=,
181
+ self.local_count
182
+ )
183
+ blk.__send__(
184
+ :local_names=,
185
+ self.local_names
186
+ )
187
+ ::Myco.branch_op(:"&?", self.new_cscope) {(
188
+ g.push_scope
189
+ g.send(
190
+ :for_method_definition,
191
+ 0
192
+ )
193
+ g.add_scope
194
+ )}
195
+ g.create_block(blk)
131
196
  )}
132
- g.create_block(blk)
133
- )}
197
+ )
134
198
  )}}
135
199
  .tap { |__c__| __c__.__name__ = :Block })})}}.instance
@@ -2,22 +2,34 @@
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::BlockArgument = ::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(:blkarg, [[:node_type, []]], nil, ::Myco.cscope.dup) { |*| nil}
6
- declare_meme(:body, [[:field, []]], nil, ::Myco.cscope.dup) { |*| nil}
7
- declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
8
- self.body.bytecode(g)
9
- done_label = g.new_label
10
- g.dup
11
- g.is_nil
12
- g.goto_if_true(done_label)
13
- g.push_cpath_top
14
- g.find_const(:Proc)
15
- g.swap
16
- g.send(
17
- :__from_block__,
18
- 1
19
- )
20
- done_label.__send__(:set!)
21
- )}
5
+ declare_meme(
6
+ :blkarg,
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
+ :bytecode,
17
+ [],
18
+ ::Object::Proc.new { |g| (
19
+ self.body.bytecode(g)
20
+ done_label = g.new_label
21
+ g.dup
22
+ g.is_nil
23
+ g.goto_if_true(done_label)
24
+ g.push_cpath_top
25
+ g.find_const(:Proc)
26
+ g.swap
27
+ g.send(
28
+ :__from_block__,
29
+ 1
30
+ )
31
+ done_label.__send__(:set!)
32
+ )}
33
+ )
22
34
  )}}
23
35
  .tap { |__c__| __c__.__name__ = :BlockArgument })})}}.instance
@@ -2,22 +2,42 @@
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::BlockLiteral = ::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(:blklit, [[:node_type, []]], nil, ::Myco.cscope.dup) { |*| nil}
6
- declare_meme(:block, [[:field, []]], nil, ::Myco.cscope.dup) { |*| nil}
7
- declare_meme(:implementation_receiver, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:ConstantAccess).new({
8
- :line => self.line,
9
- :toplevel => true,
10
- :names => [
11
- :Ruby,
12
- :Proc
13
- ]
14
- }))}
15
- declare_meme(:implementation, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Invoke).new({
16
- :line => self.line,
17
- :receiver => self.implementation_receiver,
18
- :name => :new,
19
- :block => self.block
20
- }))}
21
- declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (self.implementation.bytecode(g))}
5
+ declare_meme(
6
+ :blklit,
7
+ [:node_type],
8
+ ::Object::Proc.new { |*| nil}
9
+ )
10
+ declare_meme(
11
+ :block,
12
+ [:field],
13
+ ::Object::Proc.new { |*| nil}
14
+ )
15
+ declare_meme(
16
+ :implementation_receiver,
17
+ [],
18
+ ::Object::Proc.new { |*| (::Myco.find_constant(:ConstantAccess).new({
19
+ :line => self.line,
20
+ :toplevel => true,
21
+ :names => [
22
+ :Ruby,
23
+ :Proc
24
+ ]
25
+ }))}
26
+ )
27
+ declare_meme(
28
+ :implementation,
29
+ [],
30
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Invoke).new({
31
+ :line => self.line,
32
+ :receiver => self.implementation_receiver,
33
+ :name => :new,
34
+ :block => self.block
35
+ }))}
36
+ )
37
+ declare_meme(
38
+ :bytecode,
39
+ [],
40
+ ::Object::Proc.new { |g| (self.implementation.bytecode(g))}
41
+ )
22
42
  )}}
23
43
  .tap { |__c__| __c__.__name__ = :BlockLiteral })})}}.instance