rubinius-compiler 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +8 -0
  3. data/lib/rubinius/compiler/compiled_file.rb +32 -32
  4. data/lib/rubinius/compiler/version.rb +2 -2
  5. data/rubinius-compiler.gemspec +6 -0
  6. data/spec/alias_spec.rb +39 -0
  7. data/spec/and_spec.rb +44 -0
  8. data/spec/array_spec.rb +110 -0
  9. data/spec/attrasgn_spec.rb +186 -0
  10. data/spec/back_ref_spec.rb +11 -0
  11. data/spec/call_spec.rb +580 -0
  12. data/spec/case_spec.rb +576 -0
  13. data/spec/cdecl_spec.rb +70 -0
  14. data/spec/class_spec.rb +120 -0
  15. data/spec/colon2_spec.rb +8 -0
  16. data/spec/colon3_spec.rb +8 -0
  17. data/spec/const_spec.rb +7 -0
  18. data/spec/custom/guards/profiler.rb +18 -0
  19. data/spec/custom/helpers/generator.rb +828 -0
  20. data/spec/custom/matchers/compile_as.rb +46 -0
  21. data/spec/custom/mspec.rb +15 -0
  22. data/spec/custom/runner/actions/debug.rb +10 -0
  23. data/spec/custom/runner/actions/gcstats.rb +17 -0
  24. data/spec/custom/runner/actions/memory.rb +11 -0
  25. data/spec/custom/runner/actions/parser.rb +14 -0
  26. data/spec/custom/runner/actions/profiler.rb +19 -0
  27. data/spec/custom/runner/relates.rb +86 -0
  28. data/spec/custom/utils/options.rb +40 -0
  29. data/spec/custom/utils/script.rb +50 -0
  30. data/spec/cvar_spec.rb +39 -0
  31. data/spec/cvasgn_spec.rb +33 -0
  32. data/spec/cvdecl_spec.rb +17 -0
  33. data/spec/defined_spec.rb +616 -0
  34. data/spec/defn_spec.rb +732 -0
  35. data/spec/defs_spec.rb +113 -0
  36. data/spec/dot2_spec.rb +16 -0
  37. data/spec/dot3_spec.rb +17 -0
  38. data/spec/dregx_spec.rb +160 -0
  39. data/spec/dstr_spec.rb +424 -0
  40. data/spec/dsym_spec.rb +18 -0
  41. data/spec/dxstr_spec.rb +24 -0
  42. data/spec/ensure_spec.rb +196 -0
  43. data/spec/false_spec.rb +7 -0
  44. data/spec/flip2_spec.rb +21 -0
  45. data/spec/flip3_spec.rb +12 -0
  46. data/spec/for_spec.rb +228 -0
  47. data/spec/gasgn_spec.rb +15 -0
  48. data/spec/generator/encode_spec.rb +34 -0
  49. data/spec/gvar_spec.rb +37 -0
  50. data/spec/hash_spec.rb +108 -0
  51. data/spec/iasgn_spec.rb +26 -0
  52. data/spec/if_spec.rb +415 -0
  53. data/spec/iter_spec.rb +1011 -0
  54. data/spec/lasgn_spec.rb +561 -0
  55. data/spec/lit_spec.rb +61 -0
  56. data/spec/masgn_spec.rb +1558 -0
  57. data/spec/match2_spec.rb +42 -0
  58. data/spec/match3_spec.rb +54 -0
  59. data/spec/match_spec.rb +29 -0
  60. data/spec/module_spec.rb +73 -0
  61. data/spec/nil_spec.rb +7 -0
  62. data/spec/not_spec.rb +47 -0
  63. data/spec/nth_ref_spec.rb +7 -0
  64. data/spec/op_asgn_spec.rb +563 -0
  65. data/spec/or_spec.rb +126 -0
  66. data/spec/postexe_spec.rb +11 -0
  67. data/spec/preexe_spec.rb +21 -0
  68. data/spec/regex_spec.rb +54 -0
  69. data/spec/rescue_spec.rb +763 -0
  70. data/spec/return_spec.rb +152 -0
  71. data/spec/sclass_spec.rb +138 -0
  72. data/spec/spec_helper.rb +12 -0
  73. data/spec/str_spec.rb +118 -0
  74. data/spec/super_spec.rb +170 -0
  75. data/spec/transforms/assembly_spec.rb +195 -0
  76. data/spec/transforms/block_given_spec.rb +75 -0
  77. data/spec/transforms/fast_coerce_spec.rb +112 -0
  78. data/spec/transforms/fast_new_spec.rb +255 -0
  79. data/spec/transforms/invoke_primitive_spec.rb +14 -0
  80. data/spec/transforms/kernel_methods_spec.rb +29 -0
  81. data/spec/transforms/primitive_spec.rb +33 -0
  82. data/spec/transforms/privately_spec.rb +24 -0
  83. data/spec/true_spec.rb +7 -0
  84. data/spec/undef_spec.rb +133 -0
  85. data/spec/until_spec.rb +254 -0
  86. data/spec/valias_spec.rb +11 -0
  87. data/spec/while_spec.rb +494 -0
  88. data/spec/xstr_spec.rb +10 -0
  89. data/spec/yield_spec.rb +92 -0
  90. data/spec/zsuper_spec.rb +63 -0
  91. metadata +258 -3
data/spec/xstr_spec.rb ADDED
@@ -0,0 +1,10 @@
1
+ describe "A Xstr node" do
2
+ relates "`touch 5`" do
3
+ compile do |g|
4
+ g.push :self
5
+ g.push_literal "touch 5"
6
+ g.string_dup
7
+ g.send :"`", 1, true
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,92 @@
1
+ describe "A Yield node" do
2
+ relates "yield(42, 24)" do
3
+ compile do |g|
4
+ g.push 42
5
+ g.push 24
6
+ g.yield_stack 2
7
+ end
8
+ end
9
+
10
+ relates "yield([42, 24])" do
11
+ compile do |g|
12
+ g.push 42
13
+ g.push 24
14
+ g.make_array 2
15
+ g.yield_stack 1
16
+ end
17
+ end
18
+
19
+ relates "yield([42])" do
20
+ compile do |g|
21
+ g.push 42
22
+ g.make_array 1
23
+ g.yield_stack 1
24
+ end
25
+ end
26
+
27
+ relates "yield([])" do
28
+ compile do |g|
29
+ g.make_array 0
30
+ g.yield_stack 1
31
+ end
32
+ end
33
+
34
+ relates "yield(42)" do
35
+ compile do |g|
36
+ g.push 42
37
+ g.yield_stack 1
38
+ end
39
+ end
40
+
41
+ relates "yield" do
42
+ compile do |g|
43
+ g.yield_stack 0
44
+ end
45
+ end
46
+
47
+ relates "yield([*[]])" do
48
+ compile do |g|
49
+ g.make_array 0
50
+ g.yield_stack 1
51
+ end
52
+ end
53
+
54
+ relates "yield([*[1]])" do
55
+ compile do |g|
56
+ g.push 1
57
+ g.make_array 1
58
+ g.yield_stack 1
59
+ end
60
+ end
61
+
62
+ relates "yield([*[1, 2]])" do
63
+ compile do |g|
64
+ g.push 1
65
+ g.push 2
66
+ g.make_array 2
67
+ g.yield_stack 1
68
+ end
69
+ end
70
+
71
+ relates "yield(*[1])" do
72
+ compile do |g|
73
+ g.push 1
74
+ g.make_array 1
75
+ g.cast_array
76
+
77
+ g.yield_splat 0
78
+ end
79
+ end
80
+
81
+ relates "yield(*[1, 2])" do
82
+ compile do |g|
83
+
84
+ g.push 1
85
+ g.push 2
86
+ g.make_array 2
87
+ g.cast_array
88
+
89
+ g.yield_splat 0
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,63 @@
1
+ describe "A Zsuper node" do
2
+ relates <<-ruby do
3
+ def x
4
+ super
5
+ end
6
+ ruby
7
+
8
+ compile do |g|
9
+ in_method :x do |d|
10
+ d.push_block
11
+ d.zsuper :x
12
+ end
13
+ end
14
+ end
15
+
16
+ relates <<-ruby do
17
+ def x(a)
18
+ super
19
+ end
20
+ ruby
21
+
22
+ compile do |g|
23
+ in_method :x do |d|
24
+ d.push_block
25
+ d.zsuper :x
26
+ end
27
+ end
28
+ end
29
+
30
+ relates <<-ruby do
31
+ def x(&block)
32
+ super
33
+ end
34
+ ruby
35
+
36
+ compile do |g|
37
+ in_method :x do |d|
38
+ proc_lbl = d.new_label
39
+
40
+ d.push_proc
41
+ d.set_local 0
42
+ d.pop
43
+
44
+ d.push_block
45
+ d.zsuper :x
46
+ end
47
+ end
48
+ end
49
+
50
+ relates <<-ruby do
51
+ def x(a, *as)
52
+ super
53
+ end
54
+ ruby
55
+
56
+ compile do |g|
57
+ in_method :x do |d|
58
+ d.push_block
59
+ d.zsuper :x
60
+ end
61
+ end
62
+ end
63
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubinius-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Shirai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-10 00:00:00.000000000 Z
11
+ date: 2014-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,90 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: mspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubinius-toolset
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubinius-processor
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubinius-ast
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubinius-bridge
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: redcard
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.0'
41
125
  description: Rubinius bytecode compiler.
42
126
  email:
43
127
  - brixen@gmail.com
@@ -46,6 +130,7 @@ extensions: []
46
130
  extra_rdoc_files: []
47
131
  files:
48
132
  - ".gitignore"
133
+ - ".travis.yml"
49
134
  - Gemfile
50
135
  - LICENSE
51
136
  - README.md
@@ -64,6 +149,91 @@ files:
64
149
  - lib/rubinius/compiler/stages.rb
65
150
  - lib/rubinius/compiler/version.rb
66
151
  - rubinius-compiler.gemspec
152
+ - spec/alias_spec.rb
153
+ - spec/and_spec.rb
154
+ - spec/array_spec.rb
155
+ - spec/attrasgn_spec.rb
156
+ - spec/back_ref_spec.rb
157
+ - spec/call_spec.rb
158
+ - spec/case_spec.rb
159
+ - spec/cdecl_spec.rb
160
+ - spec/class_spec.rb
161
+ - spec/colon2_spec.rb
162
+ - spec/colon3_spec.rb
163
+ - spec/const_spec.rb
164
+ - spec/custom/guards/profiler.rb
165
+ - spec/custom/helpers/generator.rb
166
+ - spec/custom/matchers/compile_as.rb
167
+ - spec/custom/mspec.rb
168
+ - spec/custom/runner/actions/debug.rb
169
+ - spec/custom/runner/actions/gcstats.rb
170
+ - spec/custom/runner/actions/memory.rb
171
+ - spec/custom/runner/actions/parser.rb
172
+ - spec/custom/runner/actions/profiler.rb
173
+ - spec/custom/runner/relates.rb
174
+ - spec/custom/utils/options.rb
175
+ - spec/custom/utils/script.rb
176
+ - spec/cvar_spec.rb
177
+ - spec/cvasgn_spec.rb
178
+ - spec/cvdecl_spec.rb
179
+ - spec/defined_spec.rb
180
+ - spec/defn_spec.rb
181
+ - spec/defs_spec.rb
182
+ - spec/dot2_spec.rb
183
+ - spec/dot3_spec.rb
184
+ - spec/dregx_spec.rb
185
+ - spec/dstr_spec.rb
186
+ - spec/dsym_spec.rb
187
+ - spec/dxstr_spec.rb
188
+ - spec/ensure_spec.rb
189
+ - spec/false_spec.rb
190
+ - spec/flip2_spec.rb
191
+ - spec/flip3_spec.rb
192
+ - spec/for_spec.rb
193
+ - spec/gasgn_spec.rb
194
+ - spec/generator/encode_spec.rb
195
+ - spec/gvar_spec.rb
196
+ - spec/hash_spec.rb
197
+ - spec/iasgn_spec.rb
198
+ - spec/if_spec.rb
199
+ - spec/iter_spec.rb
200
+ - spec/lasgn_spec.rb
201
+ - spec/lit_spec.rb
202
+ - spec/masgn_spec.rb
203
+ - spec/match2_spec.rb
204
+ - spec/match3_spec.rb
205
+ - spec/match_spec.rb
206
+ - spec/module_spec.rb
207
+ - spec/nil_spec.rb
208
+ - spec/not_spec.rb
209
+ - spec/nth_ref_spec.rb
210
+ - spec/op_asgn_spec.rb
211
+ - spec/or_spec.rb
212
+ - spec/postexe_spec.rb
213
+ - spec/preexe_spec.rb
214
+ - spec/regex_spec.rb
215
+ - spec/rescue_spec.rb
216
+ - spec/return_spec.rb
217
+ - spec/sclass_spec.rb
218
+ - spec/spec_helper.rb
219
+ - spec/str_spec.rb
220
+ - spec/super_spec.rb
221
+ - spec/transforms/assembly_spec.rb
222
+ - spec/transforms/block_given_spec.rb
223
+ - spec/transforms/fast_coerce_spec.rb
224
+ - spec/transforms/fast_new_spec.rb
225
+ - spec/transforms/invoke_primitive_spec.rb
226
+ - spec/transforms/kernel_methods_spec.rb
227
+ - spec/transforms/primitive_spec.rb
228
+ - spec/transforms/privately_spec.rb
229
+ - spec/true_spec.rb
230
+ - spec/undef_spec.rb
231
+ - spec/until_spec.rb
232
+ - spec/valias_spec.rb
233
+ - spec/while_spec.rb
234
+ - spec/xstr_spec.rb
235
+ - spec/yield_spec.rb
236
+ - spec/zsuper_spec.rb
67
237
  homepage: https://github.com/rubinius/rubinius-compiler
68
238
  licenses:
69
239
  - BSD
@@ -88,4 +258,89 @@ rubygems_version: 2.2.2
88
258
  signing_key:
89
259
  specification_version: 4
90
260
  summary: Rubinius bytecode compiler.
91
- test_files: []
261
+ test_files:
262
+ - spec/alias_spec.rb
263
+ - spec/and_spec.rb
264
+ - spec/array_spec.rb
265
+ - spec/attrasgn_spec.rb
266
+ - spec/back_ref_spec.rb
267
+ - spec/call_spec.rb
268
+ - spec/case_spec.rb
269
+ - spec/cdecl_spec.rb
270
+ - spec/class_spec.rb
271
+ - spec/colon2_spec.rb
272
+ - spec/colon3_spec.rb
273
+ - spec/const_spec.rb
274
+ - spec/custom/guards/profiler.rb
275
+ - spec/custom/helpers/generator.rb
276
+ - spec/custom/matchers/compile_as.rb
277
+ - spec/custom/mspec.rb
278
+ - spec/custom/runner/actions/debug.rb
279
+ - spec/custom/runner/actions/gcstats.rb
280
+ - spec/custom/runner/actions/memory.rb
281
+ - spec/custom/runner/actions/parser.rb
282
+ - spec/custom/runner/actions/profiler.rb
283
+ - spec/custom/runner/relates.rb
284
+ - spec/custom/utils/options.rb
285
+ - spec/custom/utils/script.rb
286
+ - spec/cvar_spec.rb
287
+ - spec/cvasgn_spec.rb
288
+ - spec/cvdecl_spec.rb
289
+ - spec/defined_spec.rb
290
+ - spec/defn_spec.rb
291
+ - spec/defs_spec.rb
292
+ - spec/dot2_spec.rb
293
+ - spec/dot3_spec.rb
294
+ - spec/dregx_spec.rb
295
+ - spec/dstr_spec.rb
296
+ - spec/dsym_spec.rb
297
+ - spec/dxstr_spec.rb
298
+ - spec/ensure_spec.rb
299
+ - spec/false_spec.rb
300
+ - spec/flip2_spec.rb
301
+ - spec/flip3_spec.rb
302
+ - spec/for_spec.rb
303
+ - spec/gasgn_spec.rb
304
+ - spec/generator/encode_spec.rb
305
+ - spec/gvar_spec.rb
306
+ - spec/hash_spec.rb
307
+ - spec/iasgn_spec.rb
308
+ - spec/if_spec.rb
309
+ - spec/iter_spec.rb
310
+ - spec/lasgn_spec.rb
311
+ - spec/lit_spec.rb
312
+ - spec/masgn_spec.rb
313
+ - spec/match2_spec.rb
314
+ - spec/match3_spec.rb
315
+ - spec/match_spec.rb
316
+ - spec/module_spec.rb
317
+ - spec/nil_spec.rb
318
+ - spec/not_spec.rb
319
+ - spec/nth_ref_spec.rb
320
+ - spec/op_asgn_spec.rb
321
+ - spec/or_spec.rb
322
+ - spec/postexe_spec.rb
323
+ - spec/preexe_spec.rb
324
+ - spec/regex_spec.rb
325
+ - spec/rescue_spec.rb
326
+ - spec/return_spec.rb
327
+ - spec/sclass_spec.rb
328
+ - spec/spec_helper.rb
329
+ - spec/str_spec.rb
330
+ - spec/super_spec.rb
331
+ - spec/transforms/assembly_spec.rb
332
+ - spec/transforms/block_given_spec.rb
333
+ - spec/transforms/fast_coerce_spec.rb
334
+ - spec/transforms/fast_new_spec.rb
335
+ - spec/transforms/invoke_primitive_spec.rb
336
+ - spec/transforms/kernel_methods_spec.rb
337
+ - spec/transforms/primitive_spec.rb
338
+ - spec/transforms/privately_spec.rb
339
+ - spec/true_spec.rb
340
+ - spec/undef_spec.rb
341
+ - spec/until_spec.rb
342
+ - spec/valias_spec.rb
343
+ - spec/while_spec.rb
344
+ - spec/xstr_spec.rb
345
+ - spec/yield_spec.rb
346
+ - spec/zsuper_spec.rb