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
@@ -8,12 +8,24 @@
8
8
  .tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
9
9
  .tap { |__c__| __c__.__name__ = :Base }
10
10
  ::Myco.cscope.for_method_definition::End = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
11
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::End.new)})}}
11
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
12
+ :construct,
13
+ [],
14
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::End.new)}
15
+ ))}}
12
16
  .tap { |__c__| __c__.__name__ = :End }
13
17
  ::Myco.cscope.for_method_definition::Item = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
14
18
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(
15
- declare_meme(:checks, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
16
- declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::Item.new({:checks => self.checks}))}
19
+ declare_meme(
20
+ :checks,
21
+ [:var],
22
+ ::Object::Proc.new { |*| nil}
23
+ )
24
+ declare_meme(
25
+ :construct,
26
+ [],
27
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::Item.new({:checks => self.checks}))}
28
+ )
17
29
  )}}
18
30
  .tap { |__c__| __c__.__name__ = :Item }
19
31
  )}}
@@ -27,126 +39,138 @@
27
39
  .tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
28
40
  .tap { |__c__| __c__.__name__ = :End }
29
41
  ::Myco.cscope.for_method_definition::Item = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
30
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:checks, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
42
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
43
+ :checks,
44
+ [:var],
45
+ ::Object::Proc.new { |*| nil}
46
+ ))}}
31
47
  .tap { |__c__| __c__.__name__ = :Item }
32
48
  )}}
33
49
  .tap { |__c__| __c__.__name__ = :Constructions }
34
50
  ::Myco.find_constant(:Constructions).component_eval {(
35
- ::Myco.find_constant(:End).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
36
- g.push_subject
37
- g.send(
38
- :size,
39
- 0
40
- )
41
- g.push_idx
42
- g.send(
43
- :>,
44
- 1
45
- )
46
- g.goto_if_true(g.overall_fail)
47
- )})}
48
- ::Myco.find_constant(:Item).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
49
- many_checks = self.checks.size.__send__(
50
- :>,
51
- 1
52
- )
53
- local_fail = g.overall_fail
54
- self.__send__(
55
- :if,
56
- many_checks
57
- ) { || (local_fail = g.new_label)}
58
- g.push_subject
59
- g.send(
60
- :size,
61
- 0
62
- )
63
- g.push_idx
64
- g.send(
65
- :>,
66
- 1
67
- )
68
- g.goto_if_false(g.overall_fail)
69
- ::Myco.branch_op(:"||", self.checks.__send__(:empty?)) {(
70
- g.push_subject_at_idx
71
- self.checks.each { |method, args, result| (
72
- self.__send__(
73
- :if,
74
- many_checks
75
- ) { || (g.dup_top)}
76
- ::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", :self.__send__(
77
- :equal?,
78
- method
79
- )) {nil}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", method.__send__(
80
- :is_a?,
81
- ::Myco.find_constant(:Symbol)
82
- )) {(
83
- args.each { |arg| (g.push_literal_or_array(arg))}
84
- g.send(
85
- method,
86
- args.size
87
- )
88
- )}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", method.__send__(
89
- :is_a?,
90
- ::Myco.find_constant(:Proc)
91
- )) {(
92
- code = method.block.compiled_code
93
- g.push_literal(code)
94
- g.swap_stack
95
- g.push_literal(code.name)
96
- g.swap_stack
97
- g.push_cpath_top
98
- g.find_const(:Myco)
99
- g.swap_stack
100
- g.push_literal_array(args)
101
- g.push_nil
102
- g.send(
103
- :invoke,
104
- 5
105
- )
106
- )}) {self.raise("Unknown type of check method: #{method}")}}}
107
- ::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", nil.__send__(
108
- :equal?,
109
- result
110
- )) {g.goto_if_not_nil(local_fail)}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", ::Myco.branch_op(:"||", ::Myco.branch_op(:"||", ::Myco.branch_op(:"||", false.__send__(
111
- :equal?,
112
- result
113
- )) {true.__send__(
114
- :equal?,
115
- result
116
- )}) {result.__send__(
117
- :is_a?,
118
- ::Myco.find_constant(:Symbol)
119
- )}) {result.__send__(
120
- :is_a?,
121
- ::Myco.find_constant(:Fixnum)
122
- )}) {(
123
- g.push_literal(result)
124
- g.goto_if_not_equal(local_fail)
125
- )}) {(
126
- g.push_literal_or_array(result)
127
- g.send(
128
- :==,
129
- 1
130
- )
131
- g.goto_if_false(local_fail)
132
- )}}
133
- )}
51
+ ::Myco.find_constant(:End).component_eval {(declare_meme(
52
+ :bytecode,
53
+ [],
54
+ ::Object::Proc.new { |g| (
55
+ g.push_subject
56
+ g.send(
57
+ :size,
58
+ 0
59
+ )
60
+ g.push_idx
61
+ g.send(
62
+ :>,
63
+ 1
64
+ )
65
+ g.goto_if_true(g.overall_fail)
66
+ )}
67
+ ))}
68
+ ::Myco.find_constant(:Item).component_eval {(declare_meme(
69
+ :bytecode,
70
+ [],
71
+ ::Object::Proc.new { |g| (
72
+ many_checks = self.checks.size.__send__(
73
+ :>,
74
+ 1
75
+ )
76
+ local_fail = g.overall_fail
134
77
  self.__send__(
135
78
  :if,
136
79
  many_checks
137
- ) { || (
138
- local_done = g.new_label
139
- g.pop
140
- g.goto(local_done)
141
- local_fail.__send__(:set!)
142
- g.pop
143
- g.goto(g.overall_fail)
144
- local_done.__send__(:set!)
80
+ ) { |*| (local_fail = g.new_label)}
81
+ g.push_subject
82
+ g.send(
83
+ :size,
84
+ 0
85
+ )
86
+ g.push_idx
87
+ g.send(
88
+ :>,
89
+ 1
90
+ )
91
+ g.goto_if_false(g.overall_fail)
92
+ ::Myco.branch_op(:"||", self.checks.__send__(:empty?)) {(
93
+ g.push_subject_at_idx
94
+ self.checks.each { |method, args, result| (
95
+ self.__send__(
96
+ :if,
97
+ many_checks
98
+ ) { |*| (g.dup_top)}
99
+ ::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", :self.__send__(
100
+ :equal?,
101
+ method
102
+ )) {nil}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", method.__send__(
103
+ :is_a?,
104
+ ::Myco.find_constant(:Symbol)
105
+ )) {(
106
+ args.each { |arg| (g.push_literal_or_array(arg))}
107
+ g.send(
108
+ method,
109
+ args.size
110
+ )
111
+ )}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", method.__send__(
112
+ :is_a?,
113
+ ::Myco.find_constant(:Proc)
114
+ )) {(
115
+ code = method.block.compiled_code
116
+ g.push_literal(code)
117
+ g.swap_stack
118
+ g.push_literal(code.name)
119
+ g.swap_stack
120
+ g.push_cpath_top
121
+ g.find_const(:Myco)
122
+ g.swap_stack
123
+ g.push_literal_array(args)
124
+ g.push_nil
125
+ g.send(
126
+ :invoke,
127
+ 5
128
+ )
129
+ )}) {self.raise("Unknown type of check method: #{method}")}}}
130
+ ::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", nil.__send__(
131
+ :equal?,
132
+ result
133
+ )) {g.goto_if_not_nil(local_fail)}) {::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", ::Myco.branch_op(:"||", ::Myco.branch_op(:"||", ::Myco.branch_op(:"||", false.__send__(
134
+ :equal?,
135
+ result
136
+ )) {true.__send__(
137
+ :equal?,
138
+ result
139
+ )}) {result.__send__(
140
+ :is_a?,
141
+ ::Myco.find_constant(:Symbol)
142
+ )}) {result.__send__(
143
+ :is_a?,
144
+ ::Myco.find_constant(:Fixnum)
145
+ )}) {(
146
+ g.push_literal(result)
147
+ g.goto_if_not_equal(local_fail)
148
+ )}) {(
149
+ g.push_literal_or_array(result)
150
+ g.send(
151
+ :==,
152
+ 1
153
+ )
154
+ g.goto_if_false(local_fail)
155
+ )}}
156
+ )}
157
+ self.__send__(
158
+ :if,
159
+ many_checks
160
+ ) { |*| (
161
+ local_done = g.new_label
162
+ g.pop
163
+ g.goto(local_done)
164
+ local_fail.__send__(:set!)
165
+ g.pop
166
+ g.goto(g.overall_fail)
167
+ local_done.__send__(:set!)
168
+ )}
145
169
  )}
170
+ g.__send__(:meta_push_1)
171
+ g.increment_idx
146
172
  )}
147
- g.__send__(:meta_push_1)
148
- g.increment_idx
149
- )})}
173
+ ))}
150
174
  )}
151
175
  )}}
152
176
  .tap { |__c__| __c__.__name__ = :Stream })}}.instance
@@ -4,54 +4,66 @@
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(:stream, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
8
- declare_meme(:raise_error, [], nil, ::Myco.cscope.dup) { |*| (::Myco.branch_op(:"&&", self.error_idx) {self.raise(
9
- ::Myco.find_constant(:SyntaxError),
10
- "Unexpected item with parser: #{self.rule} at index: #{self.error_idx}, item: #{self.stream.__send__(
11
- :[],
12
- self.error_idx
13
- ).inspect}"
14
- )})}
7
+ declare_meme(
8
+ :stream,
9
+ [:var],
10
+ ::Object::Proc.new { |*| nil}
11
+ )
12
+ declare_meme(
13
+ :raise_error,
14
+ [],
15
+ ::Object::Proc.new { |*| (::Myco.branch_op(:"&&", self.error_idx) {self.raise(
16
+ ::Myco.find_constant(:SyntaxError),
17
+ "Unexpected item with parser: #{self.rule} at index: #{self.error_idx}, item: #{self.stream.__send__(
18
+ :[],
19
+ self.error_idx
20
+ ).inspect}"
21
+ )})}
22
+ )
15
23
  )}}
16
24
  .tap { |__c__| __c__.__name__ = :State }
17
- declare_meme(:parse, [], nil, ::Myco.cscope.dup) { |stream, rule:"root", start_idx:0| (
18
- worker = self.new_worker
19
- processor = self.new_processor
20
- state = ::Myco.find_constant(:State).new({
21
- :stream => stream,
22
- :rule => rule.to_sym,
23
- :start_idx => start_idx.to_i
24
- })
25
- state.__send__(
26
- :end_idx=,
27
- worker.__send__(
28
- state.rule,
29
- state.stream,
30
- state.start_idx
31
- )
32
- )
33
- ::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", state.end_idx) {(
34
- processor.__send__(
35
- :string=,
36
- state.stream
37
- )
38
- processor.__send__(
39
- :capture_items=,
40
- self.captures_of_worker(worker)
41
- )
42
- ::Myco.branch_op(:"&&", (Rubinius::Type.object_respond_to?(self.grammar, :tokenizer).false? ? ::Myco::Void : self.grammar.tokenizer)) {processor.__send__(
43
- :tokenizer=,
44
- self.grammar.tokenizer
45
- )}
25
+ declare_meme(
26
+ :parse,
27
+ [],
28
+ ::Object::Proc.new { |stream, rule:"root", start_idx:0| (
29
+ worker = self.new_worker
30
+ processor = self.new_processor
31
+ state = ::Myco.find_constant(:State).new({
32
+ :stream => stream,
33
+ :rule => rule.to_sym,
34
+ :start_idx => start_idx.to_i
35
+ })
46
36
  state.__send__(
47
- :result=,
48
- processor.process
37
+ :end_idx=,
38
+ worker.__send__(
39
+ state.rule,
40
+ state.stream,
41
+ state.start_idx
42
+ )
49
43
  )
50
- )}) {state.__send__(
51
- :error_idx=,
52
- self.highest_idx_of_worker(worker)
44
+ ::Myco.branch_op(:"??", ::Myco.branch_op(:"&?", state.end_idx) {(
45
+ processor.__send__(
46
+ :string=,
47
+ state.stream
48
+ )
49
+ processor.__send__(
50
+ :capture_items=,
51
+ self.captures_of_worker(worker)
52
+ )
53
+ ::Myco.branch_op(:"&&", (Rubinius::Type.object_respond_to?(self.grammar, :tokenizer).false? ? ::Myco::Void : self.grammar.tokenizer)) {processor.__send__(
54
+ :tokenizer=,
55
+ self.grammar.tokenizer
56
+ )}
57
+ state.__send__(
58
+ :result=,
59
+ processor.process
60
+ )
61
+ )}) {state.__send__(
62
+ :error_idx=,
63
+ self.highest_idx_of_worker(worker)
64
+ )}
65
+ state
53
66
  )}
54
- state
55
- )}
67
+ )
56
68
  )}}
57
69
  .tap { |__c__| __c__.__name__ = :Parser })})}}.instance
@@ -8,34 +8,74 @@
8
8
  .tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
9
9
  .tap { |__c__| __c__.__name__ = :Base }
10
10
  ::Myco.cscope.for_method_definition::AnyCharacter = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
11
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::AnyCharacter.new)})}}
11
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
12
+ :construct,
13
+ [],
14
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::AnyCharacter.new)}
15
+ ))}}
12
16
  .tap { |__c__| __c__.__name__ = :AnyCharacter }
13
17
  ::Myco.cscope.for_method_definition::Character = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
14
18
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(
15
- declare_meme(:code, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
16
- declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::Character.new({:code => self.code}))}
19
+ declare_meme(
20
+ :code,
21
+ [:var],
22
+ ::Object::Proc.new { |*| nil}
23
+ )
24
+ declare_meme(
25
+ :construct,
26
+ [],
27
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::Character.new({:code => self.code}))}
28
+ )
17
29
  )}}
18
30
  .tap { |__c__| __c__.__name__ = :Character }
19
31
  ::Myco.cscope.for_method_definition::CharacterString = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
20
32
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(
21
- declare_meme(:codes, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
22
- declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::CharacterString.new({:codes => self.codes}))}
33
+ declare_meme(
34
+ :codes,
35
+ [:var],
36
+ ::Object::Proc.new { |*| nil}
37
+ )
38
+ declare_meme(
39
+ :construct,
40
+ [],
41
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::CharacterString.new({:codes => self.codes}))}
42
+ )
23
43
  )}}
24
44
  .tap { |__c__| __c__.__name__ = :CharacterString }
25
45
  ::Myco.cscope.for_method_definition::CharacterSet = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
26
46
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(
27
- declare_meme(:codes, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
28
- declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::CharacterSet.new({:codes => self.codes}))}
47
+ declare_meme(
48
+ :codes,
49
+ [:var],
50
+ ::Object::Proc.new { |*| nil}
51
+ )
52
+ declare_meme(
53
+ :construct,
54
+ [],
55
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::CharacterSet.new({:codes => self.codes}))}
56
+ )
29
57
  )}}
30
58
  .tap { |__c__| __c__.__name__ = :CharacterSet }
31
59
  ::Myco.cscope.for_method_definition::CharacterRange = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
32
60
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(
33
- declare_meme(:start, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
34
- declare_meme(:stop, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
35
- declare_meme(:construct, [], nil, ::Myco.cscope.dup) { |*| (::Myco.find_constant(:Constructions)::CharacterRange.new({
36
- :start => self.start,
37
- :stop => self.stop
38
- }))}
61
+ declare_meme(
62
+ :start,
63
+ [:var],
64
+ ::Object::Proc.new { |*| nil}
65
+ )
66
+ declare_meme(
67
+ :stop,
68
+ [:var],
69
+ ::Object::Proc.new { |*| nil}
70
+ )
71
+ declare_meme(
72
+ :construct,
73
+ [],
74
+ ::Object::Proc.new { |*| (::Myco.find_constant(:Constructions)::CharacterRange.new({
75
+ :start => self.start,
76
+ :stop => self.stop
77
+ }))}
78
+ )
39
79
  )}}
40
80
  .tap { |__c__| __c__.__name__ = :CharacterRange }
41
81
  )}}
@@ -49,99 +89,139 @@
49
89
  .tap { |__c__| __c__.__last__ = __c__.component_eval {nil}}
50
90
  .tap { |__c__| __c__.__name__ = :AnyCharacter }
51
91
  ::Myco.cscope.for_method_definition::Character = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
52
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:code, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
92
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
93
+ :code,
94
+ [:var],
95
+ ::Object::Proc.new { |*| nil}
96
+ ))}}
53
97
  .tap { |__c__| __c__.__name__ = :Character }
54
98
  ::Myco.cscope.for_method_definition::CharacterString = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
55
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:codes, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
99
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
100
+ :codes,
101
+ [:var],
102
+ ::Object::Proc.new { |*| nil}
103
+ ))}}
56
104
  .tap { |__c__| __c__.__name__ = :CharacterString }
57
105
  ::Myco.cscope.for_method_definition::CharacterSet = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
58
- .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(:codes, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil})}}
106
+ .tap { |__c__| __c__.__last__ = __c__.component_eval {(declare_meme(
107
+ :codes,
108
+ [:var],
109
+ ::Object::Proc.new { |*| nil}
110
+ ))}}
59
111
  .tap { |__c__| __c__.__name__ = :CharacterSet }
60
112
  ::Myco.cscope.for_method_definition::CharacterRange = ::Myco::Component.new([::Myco.find_constant(:Base)], ::Myco.cscope.for_method_definition, __FILE__, __LINE__)
61
113
  .tap { |__c__| __c__.__last__ = __c__.component_eval {(
62
- declare_meme(:start, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
63
- declare_meme(:stop, [[:var, []]], nil, ::Myco.cscope.dup) { |*| nil}
114
+ declare_meme(
115
+ :start,
116
+ [:var],
117
+ ::Object::Proc.new { |*| nil}
118
+ )
119
+ declare_meme(
120
+ :stop,
121
+ [:var],
122
+ ::Object::Proc.new { |*| nil}
123
+ )
64
124
  )}}
65
125
  .tap { |__c__| __c__.__name__ = :CharacterRange }
66
126
  )}}
67
127
  .tap { |__c__| __c__.__name__ = :Constructions }
68
128
  ::Myco.find_constant(:Constructions).component_eval {(
69
- ::Myco.find_constant(:AnyCharacter).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
70
- g.push_idx
71
- g.push_subject
72
- g.send(
73
- :size,
74
- 0
75
- )
76
- g.send(
77
- :==,
78
- 1
79
- )
80
- g.goto_if_true(g.overall_fail)
81
- g.__send__(:meta_push_1)
82
- g.increment_idx
83
- )})}
84
- ::Myco.find_constant(:Character).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
85
- g.push_literal(self.code.chr)
86
- g.push_subject_chr_at_idx
87
- g.send(
88
- :==,
89
- 1
90
- )
91
- g.goto_if_false(g.overall_fail)
92
- g.__send__(:meta_push_1)
93
- g.increment_idx
94
- )})}
129
+ ::Myco.find_constant(:AnyCharacter).component_eval {(declare_meme(
130
+ :bytecode,
131
+ [],
132
+ ::Object::Proc.new { |g| (
133
+ g.push_idx
134
+ g.push_subject
135
+ g.send(
136
+ :size,
137
+ 0
138
+ )
139
+ g.send(
140
+ :==,
141
+ 1
142
+ )
143
+ g.goto_if_true(g.overall_fail)
144
+ g.__send__(:meta_push_1)
145
+ g.increment_idx
146
+ )}
147
+ ))}
148
+ ::Myco.find_constant(:Character).component_eval {(declare_meme(
149
+ :bytecode,
150
+ [],
151
+ ::Object::Proc.new { |g| (
152
+ g.push_literal(self.code.chr)
153
+ g.push_subject_chr_at_idx
154
+ g.send(
155
+ :==,
156
+ 1
157
+ )
158
+ g.goto_if_false(g.overall_fail)
159
+ g.__send__(:meta_push_1)
160
+ g.increment_idx
161
+ )}
162
+ ))}
95
163
  ::Myco.cscope.for_method_definition::STRING_HACK_PATCH = (::Myco.find_constant(:Ruby).eval("\n class ::String\n def compare_substring_safe(*args)\n compare_substring(*args)\n rescue Exception\n nil\n end\n end\n "))
96
- ::Myco.find_constant(:CharacterString).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
97
- string = self.codes.map(&:chr).join
98
- g.push_literal(string)
99
- g.push_subject
100
- g.push_idx
101
- g.push_int(string.size)
102
- g.send(
103
- :compare_substring_safe,
104
- 3
105
- )
106
- g.__send__(:meta_push_0)
107
- g.goto_if_not_equal(g.overall_fail)
108
- g.push_int(string.size)
109
- g.increment_idx
110
- )})}
111
- ::Myco.find_constant(:CharacterSet).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
112
- string = self.codes.map(&:chr).join
113
- g.push_subject_chr_at_idx
114
- g.goto_if_nil(g.overall_fail)
115
- g.push_literal(string)
116
- g.push_subject_chr_at_idx
117
- g.__send__(:meta_push_0)
118
- g.send(
119
- :find_string,
120
- 2
121
- )
122
- g.goto_if_false(g.overall_fail)
123
- g.__send__(:meta_push_1)
124
- g.increment_idx
125
- )})}
126
- ::Myco.find_constant(:CharacterRange).component_eval {(declare_meme(:bytecode, [], nil, ::Myco.cscope.dup) { |g| (
127
- codes = ::Myco.find_constant(:Range).new(
128
- self.start,
129
- self.stop
130
- )
131
- string = codes.map(&:chr).join
132
- g.push_subject_chr_at_idx
133
- g.goto_if_nil(g.overall_fail)
134
- g.push_literal(string)
135
- g.push_subject_chr_at_idx
136
- g.__send__(:meta_push_0)
137
- g.send(
138
- :find_string,
139
- 2
140
- )
141
- g.goto_if_false(g.overall_fail)
142
- g.__send__(:meta_push_1)
143
- g.increment_idx
144
- )})}
164
+ ::Myco.find_constant(:CharacterString).component_eval {(declare_meme(
165
+ :bytecode,
166
+ [],
167
+ ::Object::Proc.new { |g| (
168
+ string = self.codes.map(&:chr).join
169
+ g.push_literal(string)
170
+ g.push_subject
171
+ g.push_idx
172
+ g.push_int(string.size)
173
+ g.send(
174
+ :compare_substring_safe,
175
+ 3
176
+ )
177
+ g.__send__(:meta_push_0)
178
+ g.goto_if_not_equal(g.overall_fail)
179
+ g.push_int(string.size)
180
+ g.increment_idx
181
+ )}
182
+ ))}
183
+ ::Myco.find_constant(:CharacterSet).component_eval {(declare_meme(
184
+ :bytecode,
185
+ [],
186
+ ::Object::Proc.new { |g| (
187
+ string = self.codes.map(&:chr).join
188
+ g.push_subject_chr_at_idx
189
+ g.goto_if_nil(g.overall_fail)
190
+ g.push_literal(string)
191
+ g.push_subject_chr_at_idx
192
+ g.__send__(:meta_push_0)
193
+ g.send(
194
+ :find_string,
195
+ 2
196
+ )
197
+ g.goto_if_false(g.overall_fail)
198
+ g.__send__(:meta_push_1)
199
+ g.increment_idx
200
+ )}
201
+ ))}
202
+ ::Myco.find_constant(:CharacterRange).component_eval {(declare_meme(
203
+ :bytecode,
204
+ [],
205
+ ::Object::Proc.new { |g| (
206
+ codes = ::Myco.find_constant(:Range).new(
207
+ self.start,
208
+ self.stop
209
+ )
210
+ string = codes.map(&:chr).join
211
+ g.push_subject_chr_at_idx
212
+ g.goto_if_nil(g.overall_fail)
213
+ g.push_literal(string)
214
+ g.push_subject_chr_at_idx
215
+ g.__send__(:meta_push_0)
216
+ g.send(
217
+ :find_string,
218
+ 2
219
+ )
220
+ g.goto_if_false(g.overall_fail)
221
+ g.__send__(:meta_push_1)
222
+ g.increment_idx
223
+ )}
224
+ ))}
145
225
  )}
146
226
  )}}
147
227
  .tap { |__c__| __c__.__name__ = :String })}}.instance