rubinius-melbourne 2.0.1.0 → 2.1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +2 -9
  4. data/Gemfile +0 -4
  5. data/Rakefile +26 -19
  6. data/ext/rubinius/melbourne/extconf.rb +4 -3
  7. data/ext/rubinius/melbourne/grammar.cpp +2 -2
  8. data/ext/rubinius/melbourne/grammar.y +2 -2
  9. data/ext/rubinius/melbourne/melbourne.cpp +4 -5
  10. data/lib/rubinius/melbourne/version.rb +2 -2
  11. data/lib/rubinius/melbourne.rb +1 -21
  12. data/rubinius-melbourne.gemspec +6 -3
  13. data/spec/alias_spec.rb +13 -18
  14. data/spec/and_spec.rb +6 -12
  15. data/spec/array_spec.rb +28 -54
  16. data/spec/attrasgn_spec.rb +60 -85
  17. data/spec/back_ref_spec.rb +6 -8
  18. data/spec/call_spec.rb +137 -225
  19. data/spec/case_spec.rb +94 -112
  20. data/spec/cdecl_spec.rb +16 -28
  21. data/spec/class_spec.rb +28 -40
  22. data/spec/colon2_spec.rb +2 -4
  23. data/spec/colon3_spec.rb +2 -4
  24. data/spec/const_spec.rb +2 -4
  25. data/spec/custom/runner/relates.rb +4 -0
  26. data/spec/cvar_spec.rb +6 -12
  27. data/spec/cvasgn_spec.rb +20 -15
  28. data/spec/defined_spec.rb +57 -55
  29. data/spec/defn_spec.rb +218 -280
  30. data/spec/defs_spec.rb +30 -38
  31. data/spec/dot2_spec.rb +2 -4
  32. data/spec/dot3_spec.rb +2 -4
  33. data/spec/dregx_spec.rb +20 -34
  34. data/spec/dstr_spec.rb +87 -111
  35. data/spec/dsym_spec.rb +5 -7
  36. data/spec/dxstr_spec.rb +2 -4
  37. data/spec/ensure_spec.rb +32 -40
  38. data/spec/false_spec.rb +2 -4
  39. data/spec/flip2_spec.rb +22 -26
  40. data/spec/flip3_spec.rb +15 -17
  41. data/spec/for_spec.rb +25 -23
  42. data/spec/gasgn_spec.rb +4 -8
  43. data/spec/gvar_spec.rb +8 -16
  44. data/spec/hash_spec.rb +14 -18
  45. data/spec/iasgn_spec.rb +8 -14
  46. data/spec/if_spec.rb +50 -80
  47. data/spec/iter_spec.rb +328 -402
  48. data/spec/lasgn_spec.rb +143 -200
  49. data/spec/lit_spec.rb +20 -40
  50. data/spec/masgn_spec.rb +278 -309
  51. data/spec/match2_spec.rb +6 -10
  52. data/spec/match3_spec.rb +9 -13
  53. data/spec/match_spec.rb +2 -4
  54. data/spec/module_spec.rb +12 -16
  55. data/spec/nil_spec.rb +2 -4
  56. data/spec/not_spec.rb +6 -8
  57. data/spec/nth_ref_spec.rb +2 -4
  58. data/spec/op_asgn_spec.rb +118 -158
  59. data/spec/or_spec.rb +18 -24
  60. data/spec/postexe_spec.rb +2 -4
  61. data/spec/regex_spec.rb +11 -19
  62. data/spec/rescue_spec.rb +135 -143
  63. data/spec/return_spec.rb +19 -36
  64. data/spec/sclass_spec.rb +26 -25
  65. data/spec/spec_helper.rb +9 -0
  66. data/spec/str_spec.rb +25 -43
  67. data/spec/super_spec.rb +31 -49
  68. data/spec/true_spec.rb +2 -4
  69. data/spec/undef_spec.rb +38 -53
  70. data/spec/until_spec.rb +13 -105
  71. data/spec/valias_spec.rb +2 -4
  72. data/spec/while_spec.rb +35 -117
  73. data/spec/xstr_spec.rb +2 -4
  74. data/spec/yield_spec.rb +22 -42
  75. data/spec/zsuper_spec.rb +8 -16
  76. metadata +64 -22
  77. data/spec/cvdecl_spec.rb +0 -12
data/spec/lit_spec.rb CHANGED
@@ -1,61 +1,41 @@
1
1
  describe "A Lit node" do
2
- relates "0b1111" do
3
- parse do
4
- [:lit, 15]
5
- end
2
+ parse "0b1111" do
3
+ [:lit, 15]
6
4
  end
7
5
 
8
- relates "1.1" do
9
- parse do
10
- [:lit, 1.1]
11
- end
6
+ parse "1.1" do
7
+ [:lit, 1.1]
12
8
  end
13
9
 
14
- relates "0xffffffffffffffff" do
15
- parse do
16
- [:lit, 18446744073709551615]
17
- end
10
+ parse "0xffffffffffffffff" do
11
+ [:lit, 18446744073709551615]
18
12
  end
19
13
 
20
- relates "0xffff_ffff_ffff_ffff" do
21
- parse do
22
- [:lit, 18446744073709551615]
23
- end
14
+ parse "0xffff_ffff_ffff_ffff" do
15
+ [:lit, 18446744073709551615]
24
16
  end
25
17
 
26
- relates "07654" do
27
- parse do
28
- [:lit, 4012]
29
- end
18
+ parse "07654" do
19
+ [:lit, 4012]
30
20
  end
31
21
 
32
- relates "-1" do
33
- parse do
34
- [:lit, -1]
35
- end
22
+ parse "-1" do
23
+ [:lit, -1]
36
24
  end
37
25
 
38
- relates "1" do
39
- parse do
40
- [:lit, 1]
41
- end
26
+ parse "1" do
27
+ [:lit, 1]
42
28
  end
43
29
 
44
- relates "8000_0000" do
45
- parse do
46
- [:lit, 80000000]
47
- end
30
+ parse "8000_0000" do
31
+ [:lit, 80000000]
48
32
  end
49
33
 
50
- relates ":x" do
51
- parse do
52
- [:lit, :x]
53
- end
34
+ parse ":x" do
35
+ [:lit, :x]
54
36
  end
55
37
 
56
- relates ":\"*args\"" do
57
- parse do
58
- [:lit, :"*args"]
59
- end
38
+ parse ":\"*args\"" do
39
+ [:lit, :"*args"]
60
40
  end
61
41
  end
data/spec/masgn_spec.rb CHANGED
@@ -1,406 +1,375 @@
1
1
  describe "A Masgn node" do
2
- relates "a, b.c = b.c, true" do
3
- parse do
4
- [:masgn,
5
- [:array,
6
- [:lasgn, :a],
7
- [:attrasgn, [:call, nil, :b, [:arglist]], :c=, [:arglist]]],
8
- [:array, [:call, [:call, nil, :b, [:arglist]], :c, [:arglist]], [:true]]]
9
- end
10
- end
11
-
12
- relates "a, b = 1, 2, 3" do
13
- parse do
14
- [:masgn,
15
- [:array, [:lasgn, :a], [:lasgn, :b]],
16
- [:array, [:lit, 1], [:lit, 2], [:lit, 3]]]
17
- end
18
- end
19
-
20
- relates "a, b = c, d" do
21
- parse do
22
- [:masgn,
23
- [:array, [:lasgn, :a], [:lasgn, :b]],
24
- [:array, [:call, nil, :c, [:arglist]], [:call, nil, :d, [:arglist]]]]
25
- end
26
- end
27
-
28
- relates "a, b, *c = 1, 2, *[3, 4]" do
29
- parse do
30
- [:masgn,
31
- [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
32
- [:array, [:lit, 1], [:lit, 2], [:splat, [:array, [:lit, 3], [:lit, 4]]]]]
33
- end
34
- end
35
-
36
- relates "a.b, a.c, _ = q" do
37
- parse do
38
- [:masgn,
39
- [:array,
40
- [:attrasgn, [:call, nil, :a, [:arglist]], :b=, [:arglist]],
41
- [:attrasgn, [:call, nil, :a, [:arglist]], :c=, [:arglist]],
42
- [:lasgn, :_]],
43
- [:to_ary, [:call, nil, :q, [:arglist]]]]
44
- end
45
- end
46
-
47
- relates <<-ruby do
2
+ parse "a, b.c = b.c, true" do
3
+ [:masgn,
4
+ [:array,
5
+ [:lasgn, :a],
6
+ [:attrasgn, [:call, nil, :b, [:arglist]], :c=, [:arglist]]],
7
+ [:array, [:call, [:call, nil, :b, [:arglist]], :c, [:arglist]], [:true]]]
8
+ end
9
+
10
+ parse "a, b = 1, 2, 3" do
11
+ [:masgn,
12
+ [:array, [:lasgn, :a], [:lasgn, :b]],
13
+ [:array, [:lit, 1], [:lit, 2], [:lit, 3]]]
14
+ end
15
+
16
+ parse "a, b = c, d" do
17
+ [:masgn,
18
+ [:array, [:lasgn, :a], [:lasgn, :b]],
19
+ [:array, [:call, nil, :c, [:arglist]], [:call, nil, :d, [:arglist]]]]
20
+ end
21
+
22
+ parse "a, b, *c = 1, 2, *[3, 4]" do
23
+ [:masgn,
24
+ [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
25
+ [:array, [:lit, 1], [:lit, 2], [:lit, 3], [:lit, 4]]]
26
+ end
27
+
28
+ parse "a.b, a.c, _ = q" do
29
+ [:masgn,
30
+ [:array,
31
+ [:attrasgn, [:call, nil, :a, [:arglist]], :b=, [:arglist]],
32
+ [:attrasgn, [:call, nil, :a, [:arglist]], :c=, [:arglist]],
33
+ [:lasgn, :_]],
34
+ [:to_ary, [:call, nil, :q, [:arglist]]]]
35
+ end
36
+
37
+ parse <<-ruby do
48
38
  a, i, j = [], 1, 2
49
39
  a[i], a[j] = a[j], a[i]
50
40
  ruby
51
41
 
52
- parse do
53
- [:block,
54
- [:masgn,
55
- [:array, [:lasgn, :a], [:lasgn, :i], [:lasgn, :j]],
56
- [:array, [:array], [:lit, 1], [:lit, 2]]],
57
- [:masgn,
58
- [:array,
59
- [:attrasgn, [:lvar, :a], :[]=, [:arglist, [:lvar, :i]]],
60
- [:attrasgn, [:lvar, :a], :[]=, [:arglist, [:lvar, :j]]]],
61
- [:array,
62
- [:call, [:lvar, :a], :[], [:arglist, [:lvar, :j]]],
63
- [:call, [:lvar, :a], :[], [:arglist, [:lvar, :i]]]]]]
64
- end
65
- end
66
-
67
- relates <<-ruby do
42
+ [:block,
43
+ [:masgn,
44
+ [:array, [:lasgn, :a], [:lasgn, :i], [:lasgn, :j]],
45
+ [:array, [:array], [:lit, 1], [:lit, 2]]],
46
+ [:masgn,
47
+ [:array,
48
+ [:attrasgn, [:lvar, :a], :[]=, [:arglist, [:lvar, :i]]],
49
+ [:attrasgn, [:lvar, :a], :[]=, [:arglist, [:lvar, :j]]]],
50
+ [:array,
51
+ [:call, [:lvar, :a], :[], [:arglist, [:lvar, :j]]],
52
+ [:call, [:lvar, :a], :[], [:arglist, [:lvar, :i]]]]]]
53
+ end
54
+
55
+ parse <<-ruby do
68
56
  c, d, e, f = [], 1, 2, 3
69
57
  a, *b = c[d] = f(e, f, c)
70
58
  ruby
71
59
 
72
- parse do
73
- [:block,
74
- [:masgn,
75
- [:array, [:lasgn, :c], [:lasgn, :d], [:lasgn, :e], [:lasgn, :f]],
76
- [:array, [:array], [:lit, 1], [:lit, 2], [:lit, 3]]],
77
- [:masgn,
78
- [:array, [:lasgn, :a], [:splat, [:lasgn, :b]]],
79
- [:to_ary,
80
- [:attrasgn,
81
- [:lvar, :c],
82
- :[]=,
83
- [:arglist,
84
- [:lvar, :d],
85
- [:call, nil, :f, [:arglist, [:lvar, :e], [:lvar, :f], [:lvar, :c]]]]]]]]
86
- end
87
- end
88
-
89
- relates "a, b.c = d, e" do
90
- parse do
91
- [:masgn,
92
- [:array,
93
- [:lasgn, :a],
94
- [:attrasgn, [:call, nil, :b, [:arglist]], :c=, [:arglist]]],
95
- [:array, [:call, nil, :d, [:arglist]], [:call, nil, :e, [:arglist]]]]
96
- end
97
- end
98
-
99
- relates "*a.m = *b" do
100
- parse do
101
- [:masgn,
102
- [:array,
103
- [:splat, [:attrasgn, [:call, nil, :a, [:arglist]], :m=, [:arglist]]]],
104
- [:splat, [:call, nil, :b, [:arglist]]]]
105
- end
106
- end
107
-
108
- relates "*a.m = b" do
109
- parse do
110
- [:masgn,
111
- [:array,
112
- [:splat, [:attrasgn, [:call, nil, :a, [:arglist]], :m=, [:arglist]]]],
113
- [:to_ary, [:call, nil, :b, [:arglist]]]]
114
- end
115
- end
116
-
117
- relates "A, B, C = 1, 2, 3" do
118
- parse do
119
- [:masgn,
120
- [:array, [:cdecl, :A], [:cdecl, :B], [:cdecl, :C]],
121
- [:array, [:lit, 1], [:lit, 2], [:lit, 3]]]
122
- end
123
- end
124
-
125
- relates "* = 1, 2" do
126
- parse do
127
- [:masgn, [:array, [:splat]], [:array, [:lit, 1], [:lit, 2]]]
128
- end
60
+ [:block,
61
+ [:masgn,
62
+ [:array, [:lasgn, :c], [:lasgn, :d], [:lasgn, :e], [:lasgn, :f]],
63
+ [:array, [:array], [:lit, 1], [:lit, 2], [:lit, 3]]],
64
+ [:masgn,
65
+ [:array, [:lasgn, :a], [:splat, [:lasgn, :b]]],
66
+ [:to_ary,
67
+ [:attrasgn,
68
+ [:lvar, :c],
69
+ :[]=,
70
+ [:arglist,
71
+ [:lvar, :d],
72
+ [:call, nil, :f, [:arglist, [:lvar, :e], [:lvar, :f], [:lvar, :c]]]]]]]]
129
73
  end
130
-
131
- relates "*$a = b" do
132
- parse do
133
- [:masgn,
134
- [:array, [:splat, [:gasgn, :$a]]],
135
- [:to_ary, [:call, nil, :b, [:arglist]]]]
136
- end
74
+
75
+ parse "a, b.c = d, e" do
76
+ [:masgn,
77
+ [:array,
78
+ [:lasgn, :a],
79
+ [:attrasgn, [:call, nil, :b, [:arglist]], :c=, [:arglist]]],
80
+ [:array, [:call, nil, :d, [:arglist]], [:call, nil, :e, [:arglist]]]]
137
81
  end
138
-
139
- relates "*$a = *b" do
140
- parse do
141
- [:masgn,
142
- [:array, [:splat, [:gasgn, :$a]]],
143
- [:splat, [:call, nil, :b, [:arglist]]]]
144
- end
82
+
83
+ parse "*a.m = *b" do
84
+ [:masgn,
85
+ [:array,
86
+ [:splat, [:attrasgn, [:call, nil, :a, [:arglist]], :m=, [:arglist]]]],
87
+ [:splat, [:call, nil, :b, [:arglist]]]]
145
88
  end
146
-
147
- relates "a, @b = c, d" do
148
- parse do
149
- [:masgn,
150
- [:array, [:lasgn, :a], [:iasgn, :@b]],
151
- [:array, [:call, nil, :c, [:arglist]], [:call, nil, :d, [:arglist]]]]
152
- end
89
+
90
+ parse "*a.m = b" do
91
+ [:masgn,
92
+ [:array,
93
+ [:splat, [:attrasgn, [:call, nil, :a, [:arglist]], :m=, [:arglist]]]],
94
+ [:array, [:call, nil, :b, [:arglist]]]]
153
95
  end
154
-
155
- relates "*@a = b" do
156
- parse do
157
- [:masgn,
158
- [:array, [:splat, [:iasgn, :@a]]],
159
- [:to_ary, [:call, nil, :b, [:arglist]]]]
160
- end
96
+
97
+ parse "A, B, C = 1, 2, 3" do
98
+ [:masgn,
99
+ [:array, [:cdecl, :A], [:cdecl, :B], [:cdecl, :C]],
100
+ [:array, [:lit, 1], [:lit, 2], [:lit, 3]]]
161
101
  end
162
-
163
- relates "*@a = *b" do
164
- parse do
165
- [:masgn,
166
- [:array, [:splat, [:iasgn, :@a]]],
167
- [:splat, [:call, nil, :b, [:arglist]]]]
168
- end
102
+
103
+ parse "* = 1, 2" do
104
+ [:masgn, [:array, [:splat]], [:array, [:lit, 1], [:lit, 2]]]
169
105
  end
170
-
171
- relates "@a, $b = 1, 2" do
172
- parse do
173
- [:masgn,
174
- [:array, [:iasgn, :@a], [:gasgn, :$b]],
175
- [:array, [:lit, 1], [:lit, 2]]]
176
- end
106
+
107
+ parse "*$a = b" do
108
+ [:masgn,
109
+ [:array, [:splat, [:gasgn, :$a]]],
110
+ [:array, [:call, nil, :b, [:arglist]]]]
177
111
  end
178
112
 
179
- relates "a, b = (@a = 1), @a" do
180
- parse do
181
- [:masgn,
182
- [:array, [:lasgn, :a], [:lasgn, :b]],
183
- [:array, [:iasgn, :@a, [:lit, 1]], [:ivar, :@a]]]
184
- end
113
+ parse "*$a = *b" do
114
+ [:masgn,
115
+ [:array, [:splat, [:gasgn, :$a]]],
116
+ [:splat, [:call, nil, :b, [:arglist]]]]
185
117
  end
186
118
 
187
- relates "@@a, @@b = 1, 2" do
188
- parse do
189
- [:masgn,
190
- [:array, [:cvdecl, :@@a], [:cvdecl, :@@b]],
191
- [:array, [:lit, 1], [:lit, 2]]]
192
- end
119
+ parse "a, @b = c, d" do
120
+ [:masgn,
121
+ [:array, [:lasgn, :a], [:iasgn, :@b]],
122
+ [:array, [:call, nil, :c, [:arglist]], [:call, nil, :d, [:arglist]]]]
193
123
  end
194
124
 
195
- relates "a, b, *c = 1, 2, 3" do
196
- parse do
197
- [:masgn,
198
- [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
199
- [:array, [:lit, 1], [:lit, 2], [:lit, 3]]]
200
- end
125
+ parse "*@a = b" do
126
+ [:masgn,
127
+ [:array, [:splat, [:iasgn, :@a]]],
128
+ [:array, [:call, nil, :b, [:arglist]]]]
201
129
  end
202
130
 
203
- relates "a, b, *c = 1, 2" do
204
- # TODO
131
+ parse "*@a = *b" do
132
+ [:masgn,
133
+ [:array, [:splat, [:iasgn, :@a]]],
134
+ [:splat, [:call, nil, :b, [:arglist]]]]
205
135
  end
206
136
 
207
- relates "a, b, c, *d = 1, 2" do
208
- # TODO
137
+ parse "@a, $b = 1, 2" do
138
+ [:masgn,
139
+ [:array, [:iasgn, :@a], [:gasgn, :$b]],
140
+ [:array, [:lit, 1], [:lit, 2]]]
209
141
  end
210
142
 
211
- relates "a, b, c = *d" do
212
- parse do
213
- [:masgn,
214
- [:array, [:lasgn, :a], [:lasgn, :b], [:lasgn, :c]],
215
- [:splat, [:call, nil, :d, [:arglist]]]]
216
- end
143
+ parse "a, b = (@a = 1), @a" do
144
+ [:masgn,
145
+ [:array, [:lasgn, :a], [:lasgn, :b]],
146
+ [:array, [:iasgn, :@a, [:lit, 1]], [:ivar, :@a]]]
217
147
  end
218
148
 
219
- relates "a, b, c = 1, *d" do
220
- parse do
221
- [:masgn,
222
- [:array, [:lasgn, :a], [:lasgn, :b], [:lasgn, :c]],
223
- [:array, [:lit, 1], [:splat, [:call, nil, :d, [:arglist]]]]]
224
- end
149
+ parse "@@a, @@b = 1, 2" do
150
+ [:masgn,
151
+ [:array, [:cvasgn, :@@a], [:cvasgn, :@@b]],
152
+ [:array, [:lit, 1], [:lit, 2]]]
225
153
  end
226
154
 
227
- relates "a, b, *c = *d" do
228
- parse do
229
- [:masgn,
230
- [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
231
- [:splat, [:call, nil, :d, [:arglist]]]]
232
- end
155
+ parse "a, b, *c = 1, 2, 3" do
156
+ [:masgn,
157
+ [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
158
+ [:array, [:lit, 1], [:lit, 2], [:lit, 3]]]
233
159
  end
234
160
 
235
- relates "*a = 1, 2, 3" do
236
- parse do
237
- [:masgn,
238
- [:array, [:splat, [:lasgn, :a]]],
239
- [:array, [:lit, 1], [:lit, 2], [:lit, 3]]]
240
- end
161
+ parse "a, b, *c = 1, 2" do
162
+ [:masgn,
163
+ [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
164
+ [:array, [:lit, 1], [:lit, 2]]]
241
165
  end
242
166
 
243
- relates "*a = b" do
244
- parse do
245
- [:masgn,
246
- [:array, [:splat, [:lasgn, :a]]],
247
- [:to_ary, [:call, nil, :b, [:arglist]]]]
248
- end
167
+ parse "a, b, c, *d = 1, 2" do
168
+ [:masgn,
169
+ [:array, [:lasgn, :a], [:lasgn, :b], [:lasgn, :c], [:splat, [:lasgn, :d]]],
170
+ [:array, [:lit, 1], [:lit, 2]]]
249
171
  end
250
172
 
251
- relates "*a = *b" do
252
- parse do
253
- [:masgn,
254
- [:array, [:splat, [:lasgn, :a]]],
255
- [:splat, [:call, nil, :b, [:arglist]]]]
256
- end
173
+ parse "a, b, c = *d" do
174
+ [:masgn,
175
+ [:array, [:lasgn, :a], [:lasgn, :b], [:lasgn, :c]],
176
+ [:splat, [:call, nil, :d, [:arglist]]]]
257
177
  end
258
178
 
259
- relates "a, (b, c) = [1, [2, 3]]" do
260
- parse do
261
- [:masgn,
262
- [:array, [:lasgn, :a], [:masgn, [:array, [:lasgn, :b], [:lasgn, :c]]]],
263
- [:to_ary, [:array, [:lit, 1], [:array, [:lit, 2], [:lit, 3]]]]]
264
- end
179
+ parse "a, b, c = 1, *d" do
180
+ [:masgn,
181
+ [:array, [:lasgn, :a], [:lasgn, :b], [:lasgn, :c]],
182
+ [:argscat, [:array, [:lit, 1]], [:call, nil, :d, [:arglist]]]]
265
183
  end
266
184
 
267
- relates "a, = *[[[1]]]" do
268
- parse do
269
- [:masgn,
270
- [:array, [:lasgn, :a]],
271
- [:splat, [:array, [:array, [:array, [:lit, 1]]]]]]
272
- end
185
+ parse "a, b, *c = *d" do
186
+ [:masgn,
187
+ [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
188
+ [:splat, [:call, nil, :d, [:arglist]]]]
273
189
  end
274
190
 
275
- relates "a, b, * = c" do
276
- parse do
277
- [:masgn,
278
- [:array, [:lasgn, :a], [:lasgn, :b], [:splat]],
279
- [:to_ary, [:call, nil, :c, [:arglist]]]]
280
- end
191
+ parse "*a = 1, 2, 3" do
192
+ [:masgn,
193
+ [:array, [:splat, [:lasgn, :a]]],
194
+ [:array, [:lit, 1], [:lit, 2], [:lit, 3]]]
281
195
  end
282
196
 
283
- relates "a, b, = c" do
284
- parse do
285
- [:masgn,
286
- [:array, [:lasgn, :a], [:lasgn, :b]],
287
- [:to_ary, [:call, nil, :c, [:arglist]]]]
288
- end
197
+ parse "*a = b" do
198
+ [:masgn,
199
+ [:array, [:splat, [:lasgn, :a]]],
200
+ [:array, [:call, nil, :b, [:arglist]]]]
289
201
  end
290
202
 
291
- relates "a, b, c = m d" do
292
- parse do
293
- [:masgn,
294
- [:array, [:lasgn, :a], [:lasgn, :b], [:lasgn, :c]],
295
- [:to_ary, [:call, nil, :m, [:arglist, [:call, nil, :d, [:arglist]]]]]]
296
- end
203
+ parse "*a = *b" do
204
+ [:masgn,
205
+ [:array, [:splat, [:lasgn, :a]]],
206
+ [:splat, [:call, nil, :b, [:arglist]]]]
297
207
  end
298
208
 
299
- relates "a, b, *c = d, e, f, g" do
209
+ parse "a, (b, c) = [1, [2, 3]]" do
210
+ [:masgn,
211
+ [:array, [:lasgn, :a], [:masgn, [:array, [:lasgn, :b], [:lasgn, :c]]]],
212
+ [:to_ary, [:array, [:lit, 1], [:array, [:lit, 2], [:lit, 3]]]]]
213
+ end
214
+
215
+ parse "a, = *[[[1]]]" do
216
+ [:masgn,
217
+ [:array, [:lasgn, :a]],
218
+ [:splat, [:array, [:array, [:array, [:lit, 1]]]]]]
219
+ end
220
+
221
+ parse "a, b, * = c" do
222
+ [:masgn,
223
+ [:array, [:lasgn, :a], [:lasgn, :b], [:splat]],
224
+ [:to_ary, [:call, nil, :c, [:arglist]]]]
225
+ end
226
+
227
+ parse "a, b, = c" do
228
+ [:masgn,
229
+ [:array, [:lasgn, :a], [:lasgn, :b]],
230
+ [:to_ary, [:call, nil, :c, [:arglist]]]]
231
+ end
232
+
233
+ parse "a, b, c = m d" do
234
+ [:masgn,
235
+ [:array, [:lasgn, :a], [:lasgn, :b], [:lasgn, :c]],
236
+ [:to_ary, [:call, nil, :m, [:arglist, [:call, nil, :d, [:arglist]]]]]]
237
+ end
300
238
 
301
- parse do
302
- [:masgn,
303
- [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
304
- [:array,
305
- [:call, nil, :d, [:arglist]],
306
- [:call, nil, :e, [:arglist]],
307
- [:call, nil, :f, [:arglist]],
308
- [:call, nil, :g, [:arglist]]]]
309
- end
239
+ parse "a, b, *c = d, e, f, g" do
240
+ [:masgn,
241
+ [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
242
+ [:array,
243
+ [:call, nil, :d, [:arglist]],
244
+ [:call, nil, :e, [:arglist]],
245
+ [:call, nil, :f, [:arglist]],
246
+ [:call, nil, :g, [:arglist]]]]
310
247
  end
311
248
 
312
- relates "a, b, *c = d.e(\"f\")" do
313
- parse do
314
- [:masgn,
315
- [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
316
- [:to_ary, [:call, [:call, nil, :d, [:arglist]], :e, [:arglist, [:str, "f"]]]]]
317
- end
249
+ parse "a, b, *c = d.e(\"f\")" do
250
+ [:masgn,
251
+ [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
252
+ [:to_ary, [:call, [:call, nil, :d, [:arglist]], :e, [:arglist, [:str, "f"]]]]]
318
253
  end
319
254
 
320
- relates "a, b, *c = d" do
321
- parse do
322
- [:masgn,
323
- [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
324
- [:to_ary, [:call, nil, :d, [:arglist]]]]
325
- end
255
+ parse "a, b, *c = d" do
256
+ [:masgn,
257
+ [:array, [:lasgn, :a], [:lasgn, :b], [:splat, [:lasgn, :c]]],
258
+ [:to_ary, [:call, nil, :d, [:arglist]]]]
326
259
  end
327
260
 
328
- relates "a, b = c" do
329
- parse do
330
- [:masgn,
331
- [:array, [:lasgn, :a], [:lasgn, :b]],
332
- [:to_ary, [:call, nil, :c, [:arglist]]]]
333
- end
261
+ parse "a, b = c" do
262
+ [:masgn,
263
+ [:array, [:lasgn, :a], [:lasgn, :b]],
264
+ [:to_ary, [:call, nil, :c, [:arglist]]]]
334
265
  end
335
266
 
336
- relates <<-ruby do
267
+ parse <<-ruby do
337
268
  m do
338
269
  a, b = 1, 2
339
270
  next
340
271
  end
341
272
  ruby
342
273
 
343
- parse do
274
+ [:call,
275
+ nil,
276
+ :m,
277
+ [:arglist,
344
278
  [:iter,
345
- [:call, nil, :m, [:arglist]],
346
- nil,
279
+ [:args],
347
280
  [:block,
348
281
  [:masgn,
349
282
  [:array, [:lasgn, :a], [:lasgn, :b]],
350
283
  [:array, [:lit, 1], [:lit, 2]]],
351
- [:next]]]
352
- end
284
+ [:next]]]]]
353
285
  end
354
286
 
355
- relates "a, (b, c) = 1" do
356
- # TODO
287
+ parse "a, (b, c) = 1" do
288
+ [:masgn,
289
+ [:array, [:lasgn, :a], [:masgn, [:array, [:lasgn, :b], [:lasgn, :c]]]],
290
+ [:to_ary, [:lit, 1]]]
357
291
  end
358
292
 
359
- relates "a, (b, c) = *1" do
360
- # TODO
293
+ parse "a, (b, c) = *1" do
294
+ [:masgn,
295
+ [:array, [:lasgn, :a], [:masgn, [:array, [:lasgn, :b], [:lasgn, :c]]]],
296
+ [:splat, [:lit, 1]]]
361
297
  end
362
298
 
363
- relates "a, (b, c) = 1, 2, 3" do
364
- # TODO
299
+ parse "a, (b, c) = 1, 2, 3" do
300
+ [:masgn,
301
+ [:array, [:lasgn, :a], [:masgn, [:array, [:lasgn, :b], [:lasgn, :c]]]],
302
+ [:array, [:lit, 1], [:lit, 2], [:lit, 3]]]
365
303
  end
366
304
 
367
- relates "a, (b, *c), d = 1, 2, 3, 4" do
368
- # TODO
305
+ parse "a, (b, *c), d = 1, 2, 3, 4" do
306
+ [:masgn,
307
+ [:array,
308
+ [:lasgn, :a],
309
+ [:masgn, [:array, [:lasgn, :b], [:splat, [:lasgn, :c]]]],
310
+ [:lasgn, :d]],
311
+ [:array, [:lit, 1], [:lit, 2], [:lit, 3], [:lit, 4]]]
369
312
  end
370
313
 
371
- relates "a, (b, c) = 1, *2" do
372
- # TODO
314
+ parse "a, (b, c) = 1, *2" do
315
+ [:masgn,
316
+ [:array, [:lasgn, :a], [:masgn, [:array, [:lasgn, :b], [:lasgn, :c]]]],
317
+ [:argscat, [:array, [:lit, 1]], [:lit, 2]]]
373
318
  end
374
319
 
375
- relates "a, (b, *c) = 1" do
376
- # TODO
320
+ parse "a, (b, *c) = 1" do
321
+ [:masgn,
322
+ [:array,
323
+ [:lasgn, :a],
324
+ [:masgn, [:array, [:lasgn, :b], [:splat, [:lasgn, :c]]]]],
325
+ [:to_ary, [:lit, 1]]]
377
326
  end
378
327
 
379
- relates "a, (b, *c) = 1, 2" do
380
- # TODO
328
+ parse "a, (b, *c) = 1, 2" do
329
+ [:masgn,
330
+ [:array,
331
+ [:lasgn, :a],
332
+ [:masgn, [:array, [:lasgn, :b], [:splat, [:lasgn, :c]]]]],
333
+ [:array, [:lit, 1], [:lit, 2]]]
381
334
  end
382
335
 
383
- relates "a, (b, *c) = *1" do
384
- # TODO
336
+ parse "a, (b, *c) = *1" do
337
+ [:masgn,
338
+ [:array,
339
+ [:lasgn, :a],
340
+ [:masgn, [:array, [:lasgn, :b], [:splat, [:lasgn, :c]]]]],
341
+ [:splat, [:lit, 1]]]
385
342
  end
386
343
 
387
- relates "a, (b, *c) = 1, *2" do
388
- # TODO
344
+ parse "a, (b, *c) = 1, *2" do
345
+ [:masgn,
346
+ [:array,
347
+ [:lasgn, :a],
348
+ [:masgn, [:array, [:lasgn, :b], [:splat, [:lasgn, :c]]]]],
349
+ [:argscat, [:array, [:lit, 1]], [:lit, 2]]]
389
350
  end
390
351
 
391
- relates "a, (*b) = 1" do
392
- # TODO
352
+ parse "a, (*b) = 1" do
353
+ [:masgn,
354
+ [:array, [:lasgn, :a], [:masgn, [:array, [:splat, [:lasgn, :b]]]]],
355
+ [:to_ary, [:lit, 1]]]
393
356
  end
394
357
 
395
- relates "a, (*b) = 1, 2" do
396
- # TODO
358
+ parse "a, (*b) = 1, 2" do
359
+ [:masgn,
360
+ [:array, [:lasgn, :a], [:masgn, [:array, [:splat, [:lasgn, :b]]]]],
361
+ [:array, [:lit, 1], [:lit, 2]]]
397
362
  end
398
363
 
399
- relates "a, (*b) = *1" do
400
- # TODO
364
+ parse "a, (*b) = *1" do
365
+ [:masgn,
366
+ [:array, [:lasgn, :a], [:masgn, [:array, [:splat, [:lasgn, :b]]]]],
367
+ [:splat, [:lit, 1]]]
401
368
  end
402
369
 
403
- relates "a, (*b) = 1, *2" do
404
- # TODO
370
+ parse "a, (*b) = 1, *2" do
371
+ [:masgn,
372
+ [:array, [:lasgn, :a], [:masgn, [:array, [:splat, [:lasgn, :b]]]]],
373
+ [:argscat, [:array, [:lit, 1]], [:lit, 2]]]
405
374
  end
406
375
  end