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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +2 -9
- data/Gemfile +0 -4
- data/Rakefile +26 -19
- data/ext/rubinius/melbourne/extconf.rb +4 -3
- data/ext/rubinius/melbourne/grammar.cpp +2 -2
- data/ext/rubinius/melbourne/grammar.y +2 -2
- data/ext/rubinius/melbourne/melbourne.cpp +4 -5
- data/lib/rubinius/melbourne/version.rb +2 -2
- data/lib/rubinius/melbourne.rb +1 -21
- data/rubinius-melbourne.gemspec +6 -3
- data/spec/alias_spec.rb +13 -18
- data/spec/and_spec.rb +6 -12
- data/spec/array_spec.rb +28 -54
- data/spec/attrasgn_spec.rb +60 -85
- data/spec/back_ref_spec.rb +6 -8
- data/spec/call_spec.rb +137 -225
- data/spec/case_spec.rb +94 -112
- data/spec/cdecl_spec.rb +16 -28
- data/spec/class_spec.rb +28 -40
- data/spec/colon2_spec.rb +2 -4
- data/spec/colon3_spec.rb +2 -4
- data/spec/const_spec.rb +2 -4
- data/spec/custom/runner/relates.rb +4 -0
- data/spec/cvar_spec.rb +6 -12
- data/spec/cvasgn_spec.rb +20 -15
- data/spec/defined_spec.rb +57 -55
- data/spec/defn_spec.rb +218 -280
- data/spec/defs_spec.rb +30 -38
- data/spec/dot2_spec.rb +2 -4
- data/spec/dot3_spec.rb +2 -4
- data/spec/dregx_spec.rb +20 -34
- data/spec/dstr_spec.rb +87 -111
- data/spec/dsym_spec.rb +5 -7
- data/spec/dxstr_spec.rb +2 -4
- data/spec/ensure_spec.rb +32 -40
- data/spec/false_spec.rb +2 -4
- data/spec/flip2_spec.rb +22 -26
- data/spec/flip3_spec.rb +15 -17
- data/spec/for_spec.rb +25 -23
- data/spec/gasgn_spec.rb +4 -8
- data/spec/gvar_spec.rb +8 -16
- data/spec/hash_spec.rb +14 -18
- data/spec/iasgn_spec.rb +8 -14
- data/spec/if_spec.rb +50 -80
- data/spec/iter_spec.rb +328 -402
- data/spec/lasgn_spec.rb +143 -200
- data/spec/lit_spec.rb +20 -40
- data/spec/masgn_spec.rb +278 -309
- data/spec/match2_spec.rb +6 -10
- data/spec/match3_spec.rb +9 -13
- data/spec/match_spec.rb +2 -4
- data/spec/module_spec.rb +12 -16
- data/spec/nil_spec.rb +2 -4
- data/spec/not_spec.rb +6 -8
- data/spec/nth_ref_spec.rb +2 -4
- data/spec/op_asgn_spec.rb +118 -158
- data/spec/or_spec.rb +18 -24
- data/spec/postexe_spec.rb +2 -4
- data/spec/regex_spec.rb +11 -19
- data/spec/rescue_spec.rb +135 -143
- data/spec/return_spec.rb +19 -36
- data/spec/sclass_spec.rb +26 -25
- data/spec/spec_helper.rb +9 -0
- data/spec/str_spec.rb +25 -43
- data/spec/super_spec.rb +31 -49
- data/spec/true_spec.rb +2 -4
- data/spec/undef_spec.rb +38 -53
- data/spec/until_spec.rb +13 -105
- data/spec/valias_spec.rb +2 -4
- data/spec/while_spec.rb +35 -117
- data/spec/xstr_spec.rb +2 -4
- data/spec/yield_spec.rb +22 -42
- data/spec/zsuper_spec.rb +8 -16
- metadata +64 -22
- data/spec/cvdecl_spec.rb +0 -12
data/spec/until_spec.rb
CHANGED
@@ -6,135 +6,43 @@ describe "An Until node" do
|
|
6
6
|
true
|
7
7
|
]
|
8
8
|
|
9
|
-
|
10
|
-
while not a
|
11
|
-
b + 1
|
12
|
-
end
|
13
|
-
ruby
|
14
|
-
|
15
|
-
parse do
|
16
|
-
pre_until_sexp
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
relates "b + 1 while not a" do
|
21
|
-
parse do
|
22
|
-
pre_until_sexp
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
relates <<-ruby do
|
9
|
+
parse <<-ruby do
|
27
10
|
until a
|
28
11
|
b + 1
|
29
12
|
end
|
30
13
|
ruby
|
31
14
|
|
32
|
-
|
33
|
-
pre_until_sexp
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
relates "b + 1 until a" do
|
38
|
-
parse do
|
39
|
-
pre_until_sexp
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
post_until_sexp = [
|
44
|
-
:until,
|
45
|
-
[:call, nil, :a, [:arglist]],
|
46
|
-
[:call, [:call, nil, :b, [:arglist]], :+, [:arglist, [:lit, 1]]],
|
47
|
-
false
|
48
|
-
]
|
49
|
-
|
50
|
-
post_until = lambda do |g|
|
51
|
-
top = g.new_label
|
52
|
-
rdo = g.new_label
|
53
|
-
brk = g.new_label
|
54
|
-
bottom = g.new_label
|
55
|
-
|
56
|
-
g.push_modifiers
|
57
|
-
|
58
|
-
top.set!
|
59
|
-
|
60
|
-
g.push :self
|
61
|
-
g.send :b, 0, true
|
62
|
-
g.push 1
|
63
|
-
g.send :+, 1, false
|
64
|
-
g.pop
|
65
|
-
|
66
|
-
rdo.set!
|
67
|
-
|
68
|
-
g.push :self
|
69
|
-
g.send :a, 0, true
|
70
|
-
g.git bottom
|
71
|
-
|
72
|
-
g.check_interrupts
|
73
|
-
g.goto top
|
74
|
-
|
75
|
-
bottom.set!
|
76
|
-
g.push :nil
|
77
|
-
|
78
|
-
brk.set!
|
79
|
-
|
80
|
-
g.pop_modifiers
|
15
|
+
pre_until_sexp
|
81
16
|
end
|
82
17
|
|
83
|
-
|
84
|
-
|
85
|
-
b + 1
|
86
|
-
end while not a
|
87
|
-
ruby
|
88
|
-
|
89
|
-
parse do
|
90
|
-
post_until_sexp
|
91
|
-
end
|
18
|
+
parse "b + 1 until a" do
|
19
|
+
pre_until_sexp
|
92
20
|
end
|
93
21
|
|
94
|
-
|
22
|
+
parse <<-ruby do
|
95
23
|
begin
|
96
24
|
b + 1
|
97
25
|
end until a
|
98
26
|
ruby
|
99
27
|
|
100
|
-
|
101
|
-
|
102
|
-
|
28
|
+
[:until,
|
29
|
+
[:call, nil, :a, [:arglist]],
|
30
|
+
[:call, [:call, nil, :b, [:arglist]], :+, [:arglist, [:lit, 1]]],
|
31
|
+
false]
|
103
32
|
end
|
104
33
|
|
105
34
|
nil_condition_sexp = [:until, [:nil], [:call, nil, :a, [:arglist]], true]
|
106
35
|
|
107
|
-
|
108
|
-
|
109
|
-
nil_condition_sexp
|
110
|
-
end
|
36
|
+
parse "a until ()" do
|
37
|
+
nil_condition_sexp
|
111
38
|
end
|
112
39
|
|
113
|
-
|
40
|
+
parse <<-ruby do
|
114
41
|
until ()
|
115
42
|
a
|
116
43
|
end
|
117
44
|
ruby
|
118
45
|
|
119
|
-
|
120
|
-
nil_condition_sexp
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
relates "a while not ()" do
|
125
|
-
parse do
|
126
|
-
nil_condition_sexp
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
relates <<-ruby do
|
131
|
-
while not ()
|
132
|
-
a
|
133
|
-
end
|
134
|
-
ruby
|
135
|
-
|
136
|
-
parse do
|
137
|
-
nil_condition_sexp
|
138
|
-
end
|
46
|
+
nil_condition_sexp
|
139
47
|
end
|
140
48
|
end
|
data/spec/valias_spec.rb
CHANGED
data/spec/while_spec.rb
CHANGED
@@ -6,163 +6,69 @@ describe "A While node" do
|
|
6
6
|
true
|
7
7
|
]
|
8
8
|
|
9
|
-
|
9
|
+
parse <<-ruby do
|
10
10
|
while a
|
11
11
|
b + 1
|
12
12
|
end
|
13
13
|
ruby
|
14
14
|
|
15
|
-
|
16
|
-
pre_while_sexp
|
17
|
-
end
|
15
|
+
pre_while_sexp
|
18
16
|
end
|
19
17
|
|
20
|
-
|
18
|
+
parse <<-ruby do
|
21
19
|
a = x
|
22
20
|
while a.b
|
23
21
|
1
|
24
22
|
end
|
25
23
|
ruby
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
[:while, [:call, [:lvar, :a], :b, [:arglist]], [:lit, 1], true]]
|
31
|
-
end
|
25
|
+
[:block,
|
26
|
+
[:lasgn, :a, [:call, nil, :x, [:arglist]]],
|
27
|
+
[:while, [:call, [:lvar, :a], :b, [:arglist]], [:lit, 1], true]]
|
32
28
|
end
|
33
29
|
|
34
|
-
|
35
|
-
|
36
|
-
pre_while_sexp
|
37
|
-
end
|
30
|
+
parse "b + 1 while a" do
|
31
|
+
pre_while_sexp
|
38
32
|
end
|
39
33
|
|
40
|
-
|
41
|
-
until not a
|
42
|
-
b + 1
|
43
|
-
end
|
44
|
-
ruby
|
45
|
-
|
46
|
-
parse do
|
47
|
-
pre_while_sexp
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
relates "b + 1 until not a" do
|
52
|
-
parse do
|
53
|
-
pre_while_sexp
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
post_while_sexp = [
|
58
|
-
:while,
|
59
|
-
[:call, nil, :a, [:arglist]],
|
60
|
-
[:call, [:call, nil, :b, [:arglist]], :+, [:arglist, [:lit, 1]]],
|
61
|
-
false
|
62
|
-
]
|
63
|
-
|
64
|
-
post_while = lambda do |g|
|
65
|
-
top = g.new_label
|
66
|
-
rdo = g.new_label
|
67
|
-
brk = g.new_label
|
68
|
-
bottom = g.new_label
|
69
|
-
|
70
|
-
g.push_modifiers
|
71
|
-
|
72
|
-
top.set!
|
73
|
-
|
74
|
-
g.push :self
|
75
|
-
g.send :b, 0, true
|
76
|
-
g.push 1
|
77
|
-
g.send :+, 1, false
|
78
|
-
g.pop
|
79
|
-
|
80
|
-
rdo.set!
|
81
|
-
|
82
|
-
g.push :self
|
83
|
-
g.send :a, 0, true
|
84
|
-
g.gif bottom
|
85
|
-
|
86
|
-
g.check_interrupts
|
87
|
-
g.goto top
|
88
|
-
|
89
|
-
bottom.set!
|
90
|
-
g.push :nil
|
91
|
-
|
92
|
-
brk.set!
|
93
|
-
g.pop_modifiers
|
94
|
-
end
|
95
|
-
|
96
|
-
relates <<-ruby do
|
34
|
+
parse <<-ruby do
|
97
35
|
begin
|
98
36
|
b + 1
|
99
37
|
end while a
|
100
38
|
ruby
|
101
39
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
relates <<-ruby do
|
108
|
-
begin
|
109
|
-
b + 1
|
110
|
-
end until not a
|
111
|
-
ruby
|
112
|
-
|
113
|
-
parse do
|
114
|
-
post_while_sexp
|
115
|
-
end
|
40
|
+
[:while,
|
41
|
+
[:call, nil, :a, [:arglist]],
|
42
|
+
[:call, [:call, nil, :b, [:arglist]], :+, [:arglist, [:lit, 1]]],
|
43
|
+
false]
|
116
44
|
end
|
117
45
|
|
118
46
|
nil_condition_sexp = [:while, [:nil], [:call, nil, :a, [:arglist]], true]
|
119
47
|
|
120
|
-
|
121
|
-
|
122
|
-
nil_condition_sexp
|
123
|
-
end
|
48
|
+
parse "a while ()" do
|
49
|
+
nil_condition_sexp
|
124
50
|
end
|
125
51
|
|
126
|
-
|
52
|
+
parse <<-ruby do
|
127
53
|
while ()
|
128
54
|
a
|
129
55
|
end
|
130
56
|
ruby
|
131
57
|
|
132
|
-
|
133
|
-
nil_condition_sexp
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
|
-
relates "a until not ()" do
|
138
|
-
|
139
|
-
parse do
|
140
|
-
nil_condition_sexp
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
relates <<-ruby do
|
145
|
-
until not ()
|
146
|
-
a
|
147
|
-
end
|
148
|
-
ruby
|
149
|
-
|
150
|
-
parse do
|
151
|
-
nil_condition_sexp
|
152
|
-
end
|
58
|
+
nil_condition_sexp
|
153
59
|
end
|
154
60
|
|
155
|
-
|
61
|
+
parse <<-ruby do
|
156
62
|
while 1
|
157
63
|
2
|
158
64
|
break :brk
|
159
65
|
end
|
160
66
|
ruby
|
161
67
|
|
162
|
-
|
68
|
+
[:while, [:lit, 1], [:block, [:lit, 2], [:break, [:lit, :brk]]], true]
|
163
69
|
end
|
164
70
|
|
165
|
-
|
71
|
+
parse <<-ruby do
|
166
72
|
while 1
|
167
73
|
begin
|
168
74
|
2
|
@@ -173,10 +79,15 @@ describe "A While node" do
|
|
173
79
|
end
|
174
80
|
ruby
|
175
81
|
|
176
|
-
|
82
|
+
[:while,
|
83
|
+
[:lit, 1],
|
84
|
+
[:rescue,
|
85
|
+
[:block, [:lit, 2], [:break, [:lit, :brk]]],
|
86
|
+
[:resbody, [:array, [:const, :StandardError]], [:lit, 3]]],
|
87
|
+
true]
|
177
88
|
end
|
178
89
|
|
179
|
-
|
90
|
+
parse <<-ruby do
|
180
91
|
while 1
|
181
92
|
begin
|
182
93
|
2
|
@@ -187,6 +98,13 @@ describe "A While node" do
|
|
187
98
|
end
|
188
99
|
ruby
|
189
100
|
|
190
|
-
|
101
|
+
[:while,
|
102
|
+
[:lit, 1],
|
103
|
+
[:rescue,
|
104
|
+
[:lit, 2],
|
105
|
+
[:resbody,
|
106
|
+
[:array, [:const, :StandardError]],
|
107
|
+
[[:lit, 3], [:break, [:lit, :brk]]]]],
|
108
|
+
true]
|
191
109
|
end
|
192
110
|
end
|
data/spec/xstr_spec.rb
CHANGED
data/spec/yield_spec.rb
CHANGED
@@ -1,65 +1,45 @@
|
|
1
1
|
describe "A Yield node" do
|
2
|
-
|
3
|
-
|
4
|
-
[:yield, [:lit, 42], [:lit, 24]]
|
5
|
-
end
|
2
|
+
parse "yield(42, 24)" do
|
3
|
+
[:yield, [:lit, 42], [:lit, 24]]
|
6
4
|
end
|
7
5
|
|
8
|
-
|
9
|
-
|
10
|
-
[:yield, [:array, [:lit, 42], [:lit, 24]]]
|
11
|
-
end
|
6
|
+
parse "yield([42, 24])" do
|
7
|
+
[:yield, [:array, [:lit, 42], [:lit, 24]]]
|
12
8
|
end
|
13
9
|
|
14
|
-
|
15
|
-
|
16
|
-
[:yield, [:array, [:lit, 42]]]
|
17
|
-
end
|
10
|
+
parse "yield([42])" do
|
11
|
+
[:yield, [:array, [:lit, 42]]]
|
18
12
|
end
|
19
13
|
|
20
|
-
|
21
|
-
|
22
|
-
[:yield, [:array]]
|
23
|
-
end
|
14
|
+
parse "yield([])" do
|
15
|
+
[:yield, [:array]]
|
24
16
|
end
|
25
17
|
|
26
|
-
|
27
|
-
|
28
|
-
[:yield, [:lit, 42]]
|
29
|
-
end
|
18
|
+
parse "yield(42)" do
|
19
|
+
[:yield, [:lit, 42]]
|
30
20
|
end
|
31
21
|
|
32
|
-
|
33
|
-
|
34
|
-
[:yield]
|
35
|
-
end
|
22
|
+
parse "yield" do
|
23
|
+
[:yield]
|
36
24
|
end
|
37
25
|
|
38
|
-
|
39
|
-
|
26
|
+
parse "yield([*[]])" do
|
27
|
+
[:yield, [:array, [:splat, [:array]]]]
|
40
28
|
end
|
41
29
|
|
42
|
-
|
43
|
-
|
44
|
-
[:yield, [:array, [:splat, [:array, [:lit, 1]]]]]
|
45
|
-
end
|
30
|
+
parse "yield([*[1]])" do
|
31
|
+
[:yield, [:array, [:splat, [:array, [:lit, 1]]]]]
|
46
32
|
end
|
47
33
|
|
48
|
-
|
49
|
-
|
50
|
-
[:yield, [:array, [:splat, [:array, [:lit, 1], [:lit, 2]]]]]
|
51
|
-
end
|
34
|
+
parse "yield([*[1, 2]])" do
|
35
|
+
[:yield, [:array, [:splat, [:array, [:lit, 1], [:lit, 2]]]]]
|
52
36
|
end
|
53
37
|
|
54
|
-
|
55
|
-
|
56
|
-
[:yield, [:splat, [:array, [:lit, 1]]]]
|
57
|
-
end
|
38
|
+
parse "yield(*[1])" do
|
39
|
+
[:yield, [:splat, [:array, [:lit, 1]]]]
|
58
40
|
end
|
59
41
|
|
60
|
-
|
61
|
-
|
62
|
-
[:yield, [:splat, [:array, [:lit, 1], [:lit, 2]]]]
|
63
|
-
end
|
42
|
+
parse "yield(*[1, 2])" do
|
43
|
+
[:yield, [:splat, [:array, [:lit, 1], [:lit, 2]]]]
|
64
44
|
end
|
65
45
|
end
|