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
@@ -11,25 +11,53 @@
11
11
  .tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
12
12
  .tap { |__c__| __c__.__name__ = :BinaryBase }
13
13
  ::Myco.cscope.for_method_definition::NegativePredicate = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
14
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::NegativePredicate)})}}
14
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
15
+ :construct_type,
16
+ [],
17
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::NegativePredicate)}
18
+ ))}}
15
19
  .tap { |__c__| __c__.__name__ = :NegativePredicate }
16
20
  ::Myco.cscope.for_method_definition::PositivePredicate = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
17
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::PositivePredicate)})}}
21
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
22
+ :construct_type,
23
+ [],
24
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::PositivePredicate)}
25
+ ))}}
18
26
  .tap { |__c__| __c__.__name__ = :PositivePredicate }
19
27
  ::Myco.cscope.for_method_definition::OneOrMore = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
20
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::OneOrMore)})}}
28
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
29
+ :construct_type,
30
+ [],
31
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::OneOrMore)}
32
+ ))}}
21
33
  .tap { |__c__| __c__.__name__ = :OneOrMore }
22
34
  ::Myco.cscope.for_method_definition::ZeroOrOne = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
23
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::ZeroOrOne)})}}
35
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
36
+ :construct_type,
37
+ [],
38
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::ZeroOrOne)}
39
+ ))}}
24
40
  .tap { |__c__| __c__.__name__ = :ZeroOrOne }
25
41
  ::Myco.cscope.for_method_definition::ZeroOrMore = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
26
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::ZeroOrMore)})}}
42
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
43
+ :construct_type,
44
+ [],
45
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::ZeroOrMore)}
46
+ ))}}
27
47
  .tap { |__c__| __c__.__name__ = :ZeroOrMore }
28
48
  ::Myco.cscope.for_method_definition::OrderedChoice = ::Myco::Component.new([::Myco.find_constant(:BinaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
29
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::OrderedChoice)})}}
49
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
50
+ :construct_type,
51
+ [],
52
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::OrderedChoice)}
53
+ ))}}
30
54
  .tap { |__c__| __c__.__name__ = :OrderedChoice }
31
55
  ::Myco.cscope.for_method_definition::Concatenation = ::Myco::Component.new([::Myco.find_constant(:BinaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
32
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:construct_type, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::Concatenation)})}}
56
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
57
+ :construct_type,
58
+ [],
59
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::Concatenation)}
60
+ ))}}
33
61
  .tap { |__c__| __c__.__name__ = :Concatenation }
34
62
  )}}
35
63
  .tap { |__c__| __c__.__name__ = :Patterns }
@@ -48,13 +76,21 @@
48
76
  .tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
49
77
  .tap { |__c__| __c__.__name__ = :PositivePredicate }
50
78
  ::Myco.cscope.for_method_definition::OneOrMore = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
51
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:inlaid, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
79
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
80
+ :inlaid,
81
+ [:var],
82
+ ::Object::Proc.new { |*| nil}
83
+ ))}}
52
84
  .tap { |__c__| __c__.__name__ = :OneOrMore }
53
85
  ::Myco.cscope.for_method_definition::ZeroOrOne = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
54
86
  .tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
55
87
  .tap { |__c__| __c__.__name__ = :ZeroOrOne }
56
88
  ::Myco.cscope.for_method_definition::ZeroOrMore = ::Myco::Component.new([::Myco.find_constant(:UnaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
57
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:inlaid, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
89
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
90
+ :inlaid,
91
+ [:var],
92
+ ::Object::Proc.new { |*| nil}
93
+ ))}}
58
94
  .tap { |__c__| __c__.__name__ = :ZeroOrMore }
59
95
  ::Myco.cscope.for_method_definition::OrderedChoice = ::Myco::Component.new([::Myco.find_constant(:BinaryBase)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
60
96
  .tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
@@ -65,232 +101,276 @@
65
101
  )}}
66
102
  .tap { |__c__| __c__.__name__ = :Constructions }
67
103
  ::Myco.find_constant(:Patterns).component_eval {(
68
- ::Myco.find_constant(:NegativePredicate).component_eval {(declare_meme(:!, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:PositivePredicate).new({:inner => self.inner}))})}
69
- ::Myco.find_constant(:PositivePredicate).component_eval {(declare_meme(:!, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:NegativePredicate).new({:inner => self.inner}))})}
70
- ::Myco.find_constant(:OrderedChoice).component_eval {(declare_meme(:/, [], nil, ::Myco.cscope.dup) { |other| (self.private.binary_right_assoc(
71
- self,
72
- other,
73
- ::Myco.find_constant(:OrderedChoice)
74
- ))})}
75
- ::Myco.find_constant(:Concatenation).component_eval {(declare_meme(:+, [], nil, ::Myco.cscope.dup) { |other=false| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", other) {self.private.binary_right_assoc(
76
- self,
77
- other,
78
- ::Myco.find_constant(:Concatenation)
79
- )}) {::Myco.find_constant(:OneOrMore).new({:inner => self})})})}
104
+ ::Myco.find_constant(:NegativePredicate).component_eval {(declare_meme(
105
+ :!,
106
+ [],
107
+ ::Object::Proc.new { |*| (::Myco.find_constant(:PositivePredicate).new({:inner => self.inner}))}
108
+ ))}
109
+ ::Myco.find_constant(:PositivePredicate).component_eval {(declare_meme(
110
+ :!,
111
+ [],
112
+ ::Object::Proc.new { |*| (::Myco.find_constant(:NegativePredicate).new({:inner => self.inner}))}
113
+ ))}
114
+ ::Myco.find_constant(:OrderedChoice).component_eval {(declare_meme(
115
+ :/,
116
+ [],
117
+ ::Object::Proc.new { |other| (self.private.binary_right_assoc(
118
+ self,
119
+ other,
120
+ ::Myco.find_constant(:OrderedChoice)
121
+ ))}
122
+ ))}
123
+ ::Myco.find_constant(:Concatenation).component_eval {(declare_meme(
124
+ :+,
125
+ [],
126
+ ::Object::Proc.new { |other=false| (::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", other) {self.private.binary_right_assoc(
127
+ self,
128
+ other,
129
+ ::Myco.find_constant(:Concatenation)
130
+ )}) {::Myco.find_constant(:OneOrMore).new({:inner => self})})}
131
+ ))}
80
132
  )}
81
133
  ::Myco.find_constant(:Constructions).component_eval {(
82
- ::Myco.find_constant(:NegativePredicate).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
83
- local_fail = g.new_label
84
- old_fail = g.overall_fail
85
- g.__send__(
86
- :overall_fail=,
87
- local_fail
88
- )
89
- self.__send__(
90
- :if,
91
- self.inner.__send__(:bytecode_can_capture?)
92
- ) { || (g.push_temp_captures)}
93
- g.push_idx
94
- self.inner.bytecode(g)
95
- g.pop_to_set_idx
96
- self.__send__(
97
- :if,
98
- self.inner.__send__(:bytecode_can_capture?)
99
- ) { || (g.pop_to_reject_captures)}
100
- g.__send__(
101
- :overall_fail=,
102
- old_fail
103
- )
104
- g.goto(g.overall_fail)
105
- local_fail.__send__(:set!)
106
- g.pop_to_set_idx
107
- self.__send__(
108
- :if,
109
- self.inner.__send__(:bytecode_can_capture?)
110
- ) { || (g.pop_to_reject_captures)}
111
- g.__send__(
112
- :overall_fail=,
113
- old_fail
114
- )
115
- )})}
116
- ::Myco.find_constant(:PositivePredicate).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
117
- local_done = g.new_label
118
- local_fail = g.new_label
119
- old_fail = g.overall_fail
120
- g.__send__(
121
- :overall_fail=,
122
- local_fail
123
- )
124
- self.__send__(
125
- :if,
126
- self.inner.__send__(:bytecode_can_capture?)
127
- ) { || (g.push_temp_captures)}
128
- g.push_idx
129
- self.inner.bytecode(g)
130
- g.pop_to_set_idx
131
- self.__send__(
132
- :if,
133
- self.inner.__send__(:bytecode_can_capture?)
134
- ) { || (g.pop_to_accept_captures)}
135
- g.__send__(
136
- :overall_fail=,
137
- old_fail
138
- )
139
- g.goto(local_done)
140
- local_fail.__send__(:set!)
141
- g.pop_to_set_idx
142
- self.__send__(
143
- :if,
144
- self.inner.__send__(:bytecode_can_capture?)
145
- ) { || (g.pop_to_reject_captures)}
146
- g.__send__(
147
- :overall_fail=,
148
- old_fail
149
- )
150
- g.goto(g.overall_fail)
151
- local_done.__send__(:set!)
152
- )})}
153
- ::Myco.find_constant(:OneOrMore).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
154
- local_retry = g.new_label
155
- local_fail = g.new_label
156
- old_fail = g.overall_fail
157
- g.__send__(
158
- :overall_fail=,
159
- local_fail
160
- )
161
- g.push_false
162
- local_retry.__send__(:set!)
163
- self.__send__(
164
- :if,
165
- self.inner.__send__(:bytecode_can_capture?)
166
- ) { || (g.push_temp_captures)}
167
- self.inner.bytecode(g)
168
- (Rubinius::Type.object_respond_to?(self.inlaid, :call).false? ? ::Myco::Void : self.inlaid.call)
169
- self.__send__(
170
- :if,
171
- self.inner.__send__(:bytecode_can_capture?)
172
- ) { || (g.pop_to_accept_captures)}
173
- g.pop
174
- g.push_true
175
- g.goto(local_retry)
176
- local_fail.__send__(:set!)
177
- self.__send__(
178
- :if,
179
- self.inner.__send__(:bytecode_can_capture?)
180
- ) { || (g.pop_to_reject_captures)}
181
- g.__send__(
182
- :overall_fail=,
183
- old_fail
184
- )
185
- g.goto_if_false(g.overall_fail)
186
- )})}
187
- ::Myco.find_constant(:ZeroOrOne).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
188
- local_done = g.new_label
189
- local_fail = g.new_label
190
- old_fail = g.overall_fail
191
- g.__send__(
192
- :overall_fail=,
193
- local_fail
194
- )
195
- self.__send__(
196
- :if,
197
- self.inner.__send__(:bytecode_can_capture?)
198
- ) { || (g.push_temp_captures)}
199
- g.push_idx
200
- self.inner.bytecode(g)
201
- g.pop
202
- self.__send__(
203
- :if,
204
- self.inner.__send__(:bytecode_can_capture?)
205
- ) { || (g.pop_to_accept_captures)}
206
- g.__send__(
207
- :overall_fail=,
208
- old_fail
209
- )
210
- g.goto(local_done)
211
- local_fail.__send__(:set!)
212
- g.pop_to_set_idx
213
- self.__send__(
214
- :if,
215
- self.inner.__send__(:bytecode_can_capture?)
216
- ) { || (g.pop_to_reject_captures)}
217
- g.__send__(
218
- :overall_fail=,
219
- old_fail
220
- )
221
- local_done.__send__(:set!)
222
- )})}
223
- ::Myco.find_constant(:ZeroOrMore).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
224
- local_retry = g.new_label
225
- local_fail = g.new_label
226
- old_fail = g.overall_fail
227
- g.__send__(
228
- :overall_fail=,
229
- local_fail
230
- )
231
- local_retry.__send__(:set!)
232
- self.__send__(
233
- :if,
234
- self.inner.__send__(:bytecode_can_capture?)
235
- ) { || (g.push_temp_captures)}
236
- self.inner.bytecode(g)
237
- (Rubinius::Type.object_respond_to?(self.inlaid, :call).false? ? ::Myco::Void : self.inlaid.call)
238
- self.__send__(
239
- :if,
240
- self.inner.__send__(:bytecode_can_capture?)
241
- ) { || (g.pop_to_accept_captures)}
242
- g.goto(local_retry)
243
- local_fail.__send__(:set!)
244
- self.__send__(
245
- :if,
246
- self.inner.__send__(:bytecode_can_capture?)
247
- ) { || (g.pop_to_reject_captures)}
248
- g.__send__(
249
- :overall_fail=,
250
- old_fail
251
- )
252
- )})}
253
- ::Myco.find_constant(:OrderedChoice).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
254
- local_done = g.new_label
255
- local_fail = g.new_label
256
- old_fail = g.overall_fail
257
- g.__send__(
258
- :overall_fail=,
259
- local_fail
260
- )
261
- self.__send__(
262
- :if,
263
- self.first.__send__(:bytecode_can_capture?)
264
- ) { || (g.push_temp_captures)}
265
- g.push_idx
266
- self.first.bytecode(g)
267
- g.pop
268
- self.__send__(
269
- :if,
270
- self.first.__send__(:bytecode_can_capture?)
271
- ) { || (g.pop_to_accept_captures)}
272
- g.__send__(
273
- :overall_fail=,
274
- old_fail
275
- )
276
- g.goto(local_done)
277
- local_fail.__send__(:set!)
278
- g.pop_to_set_idx
279
- self.__send__(
280
- :if,
281
- self.first.__send__(:bytecode_can_capture?)
282
- ) { || (g.pop_to_reject_captures)}
283
- g.__send__(
284
- :overall_fail=,
285
- old_fail
286
- )
287
- self.second.bytecode(g)
288
- local_done.__send__(:set!)
289
- )})}
290
- ::Myco.find_constant(:Concatenation).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
291
- self.first.bytecode(g)
292
- self.second.bytecode(g)
293
- )})}
134
+ ::Myco.find_constant(:NegativePredicate).component_eval {(declare_meme(
135
+ :bytecode,
136
+ [],
137
+ ::Object::Proc.new { |g| (
138
+ local_fail = g.new_label
139
+ old_fail = g.overall_fail
140
+ g.__send__(
141
+ :overall_fail=,
142
+ local_fail
143
+ )
144
+ self.__send__(
145
+ :if,
146
+ self.inner.__send__(:bytecode_can_capture?)
147
+ ) { |*| (g.push_temp_captures)}
148
+ g.push_idx
149
+ self.inner.bytecode(g)
150
+ g.pop_to_set_idx
151
+ self.__send__(
152
+ :if,
153
+ self.inner.__send__(:bytecode_can_capture?)
154
+ ) { |*| (g.pop_to_reject_captures)}
155
+ g.__send__(
156
+ :overall_fail=,
157
+ old_fail
158
+ )
159
+ g.goto(g.overall_fail)
160
+ local_fail.__send__(:set!)
161
+ g.pop_to_set_idx
162
+ self.__send__(
163
+ :if,
164
+ self.inner.__send__(:bytecode_can_capture?)
165
+ ) { |*| (g.pop_to_reject_captures)}
166
+ g.__send__(
167
+ :overall_fail=,
168
+ old_fail
169
+ )
170
+ )}
171
+ ))}
172
+ ::Myco.find_constant(:PositivePredicate).component_eval {(declare_meme(
173
+ :bytecode,
174
+ [],
175
+ ::Object::Proc.new { |g| (
176
+ local_done = g.new_label
177
+ local_fail = g.new_label
178
+ old_fail = g.overall_fail
179
+ g.__send__(
180
+ :overall_fail=,
181
+ local_fail
182
+ )
183
+ self.__send__(
184
+ :if,
185
+ self.inner.__send__(:bytecode_can_capture?)
186
+ ) { |*| (g.push_temp_captures)}
187
+ g.push_idx
188
+ self.inner.bytecode(g)
189
+ g.pop_to_set_idx
190
+ self.__send__(
191
+ :if,
192
+ self.inner.__send__(:bytecode_can_capture?)
193
+ ) { |*| (g.pop_to_accept_captures)}
194
+ g.__send__(
195
+ :overall_fail=,
196
+ old_fail
197
+ )
198
+ g.goto(local_done)
199
+ local_fail.__send__(:set!)
200
+ g.pop_to_set_idx
201
+ self.__send__(
202
+ :if,
203
+ self.inner.__send__(:bytecode_can_capture?)
204
+ ) { |*| (g.pop_to_reject_captures)}
205
+ g.__send__(
206
+ :overall_fail=,
207
+ old_fail
208
+ )
209
+ g.goto(g.overall_fail)
210
+ local_done.__send__(:set!)
211
+ )}
212
+ ))}
213
+ ::Myco.find_constant(:OneOrMore).component_eval {(declare_meme(
214
+ :bytecode,
215
+ [],
216
+ ::Object::Proc.new { |g| (
217
+ local_retry = g.new_label
218
+ local_fail = g.new_label
219
+ old_fail = g.overall_fail
220
+ g.__send__(
221
+ :overall_fail=,
222
+ local_fail
223
+ )
224
+ g.push_false
225
+ local_retry.__send__(:set!)
226
+ self.__send__(
227
+ :if,
228
+ self.inner.__send__(:bytecode_can_capture?)
229
+ ) { |*| (g.push_temp_captures)}
230
+ self.inner.bytecode(g)
231
+ (Rubinius::Type.object_respond_to?(self.inlaid, :call).false? ? ::Myco::Void : self.inlaid.call)
232
+ self.__send__(
233
+ :if,
234
+ self.inner.__send__(:bytecode_can_capture?)
235
+ ) { |*| (g.pop_to_accept_captures)}
236
+ g.pop
237
+ g.push_true
238
+ g.goto(local_retry)
239
+ local_fail.__send__(:set!)
240
+ self.__send__(
241
+ :if,
242
+ self.inner.__send__(:bytecode_can_capture?)
243
+ ) { |*| (g.pop_to_reject_captures)}
244
+ g.__send__(
245
+ :overall_fail=,
246
+ old_fail
247
+ )
248
+ g.goto_if_false(g.overall_fail)
249
+ )}
250
+ ))}
251
+ ::Myco.find_constant(:ZeroOrOne).component_eval {(declare_meme(
252
+ :bytecode,
253
+ [],
254
+ ::Object::Proc.new { |g| (
255
+ local_done = g.new_label
256
+ local_fail = g.new_label
257
+ old_fail = g.overall_fail
258
+ g.__send__(
259
+ :overall_fail=,
260
+ local_fail
261
+ )
262
+ self.__send__(
263
+ :if,
264
+ self.inner.__send__(:bytecode_can_capture?)
265
+ ) { |*| (g.push_temp_captures)}
266
+ g.push_idx
267
+ self.inner.bytecode(g)
268
+ g.pop
269
+ self.__send__(
270
+ :if,
271
+ self.inner.__send__(:bytecode_can_capture?)
272
+ ) { |*| (g.pop_to_accept_captures)}
273
+ g.__send__(
274
+ :overall_fail=,
275
+ old_fail
276
+ )
277
+ g.goto(local_done)
278
+ local_fail.__send__(:set!)
279
+ g.pop_to_set_idx
280
+ self.__send__(
281
+ :if,
282
+ self.inner.__send__(:bytecode_can_capture?)
283
+ ) { |*| (g.pop_to_reject_captures)}
284
+ g.__send__(
285
+ :overall_fail=,
286
+ old_fail
287
+ )
288
+ local_done.__send__(:set!)
289
+ )}
290
+ ))}
291
+ ::Myco.find_constant(:ZeroOrMore).component_eval {(declare_meme(
292
+ :bytecode,
293
+ [],
294
+ ::Object::Proc.new { |g| (
295
+ local_retry = g.new_label
296
+ local_fail = g.new_label
297
+ old_fail = g.overall_fail
298
+ g.__send__(
299
+ :overall_fail=,
300
+ local_fail
301
+ )
302
+ local_retry.__send__(:set!)
303
+ self.__send__(
304
+ :if,
305
+ self.inner.__send__(:bytecode_can_capture?)
306
+ ) { |*| (g.push_temp_captures)}
307
+ self.inner.bytecode(g)
308
+ (Rubinius::Type.object_respond_to?(self.inlaid, :call).false? ? ::Myco::Void : self.inlaid.call)
309
+ self.__send__(
310
+ :if,
311
+ self.inner.__send__(:bytecode_can_capture?)
312
+ ) { |*| (g.pop_to_accept_captures)}
313
+ g.goto(local_retry)
314
+ local_fail.__send__(:set!)
315
+ self.__send__(
316
+ :if,
317
+ self.inner.__send__(:bytecode_can_capture?)
318
+ ) { |*| (g.pop_to_reject_captures)}
319
+ g.__send__(
320
+ :overall_fail=,
321
+ old_fail
322
+ )
323
+ )}
324
+ ))}
325
+ ::Myco.find_constant(:OrderedChoice).component_eval {(declare_meme(
326
+ :bytecode,
327
+ [],
328
+ ::Object::Proc.new { |g| (
329
+ local_done = g.new_label
330
+ local_fail = g.new_label
331
+ old_fail = g.overall_fail
332
+ g.__send__(
333
+ :overall_fail=,
334
+ local_fail
335
+ )
336
+ self.__send__(
337
+ :if,
338
+ self.first.__send__(:bytecode_can_capture?)
339
+ ) { |*| (g.push_temp_captures)}
340
+ g.push_idx
341
+ self.first.bytecode(g)
342
+ g.pop
343
+ self.__send__(
344
+ :if,
345
+ self.first.__send__(:bytecode_can_capture?)
346
+ ) { |*| (g.pop_to_accept_captures)}
347
+ g.__send__(
348
+ :overall_fail=,
349
+ old_fail
350
+ )
351
+ g.goto(local_done)
352
+ local_fail.__send__(:set!)
353
+ g.pop_to_set_idx
354
+ self.__send__(
355
+ :if,
356
+ self.first.__send__(:bytecode_can_capture?)
357
+ ) { |*| (g.pop_to_reject_captures)}
358
+ g.__send__(
359
+ :overall_fail=,
360
+ old_fail
361
+ )
362
+ self.second.bytecode(g)
363
+ local_done.__send__(:set!)
364
+ )}
365
+ ))}
366
+ ::Myco.find_constant(:Concatenation).component_eval {(declare_meme(
367
+ :bytecode,
368
+ [],
369
+ ::Object::Proc.new { |g| (
370
+ self.first.bytecode(g)
371
+ self.second.bytecode(g)
372
+ )}
373
+ ))}
294
374
  )}
295
375
  )}}
296
376
  .tap { |__c__| __c__.__name__ = :Composite })}}.instance