rubinius-melbourne 2.2.2.0 → 2.3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -0
- data/ext/rubinius/melbourne/symbols.cpp +2 -0
- data/ext/rubinius/melbourne/symbols.hpp +1 -0
- data/ext/rubinius/melbourne/visitor.cpp +17 -0
- data/lib/rubinius/melbourne/version.rb +1 -1
- data/spec/cdecl_spec.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eac46b199e3ca8e71fc0016f67ca06b5b69884b2
|
4
|
+
data.tar.gz: 0f9dc4c9bc85d5d2c381571b6bf837f6d4b1470f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b32b151e38cd5bf8af7c214b8afde1aba30bc564d115ae67854e6b5858e3e95fa13e2b4a80d783e510fcd20521aa79bead9850c4a1c5a92715196dfb3697c96
|
7
|
+
data.tar.gz: ec446e0a9512dcd725cbb8731f28015bf83e0dc6b0c826bf3a3694fb86cde45b33dfb6f36ba9425b6d837cca2e3f5aaa5e88f53861eafde5f2f0be37feaba8cc
|
data/Rakefile
CHANGED
@@ -80,6 +80,7 @@ namespace MELBOURNE {
|
|
80
80
|
ID rb_sOpAsgn2;
|
81
81
|
ID rb_sOpAsgnAnd;
|
82
82
|
ID rb_sOpAsgnOr;
|
83
|
+
ID rb_sOpCDecl;
|
83
84
|
ID rb_sOptArg;
|
84
85
|
ID rb_sOr;
|
85
86
|
ID rb_sPostExe;
|
@@ -195,6 +196,7 @@ namespace MELBOURNE {
|
|
195
196
|
rb_sOpAsgn2 = rb_intern("process_op_asgn2");
|
196
197
|
rb_sOpAsgnAnd = rb_intern("process_op_asgn_and");
|
197
198
|
rb_sOpAsgnOr = rb_intern("process_op_asgn_or");
|
199
|
+
rb_sOpCDecl = rb_intern("process_op_cdecl");
|
198
200
|
rb_sOptArg = rb_intern("process_opt_arg");
|
199
201
|
rb_sOr = rb_intern("process_or");
|
200
202
|
rb_sPostExe = rb_intern("process_postexe");
|
@@ -498,6 +498,23 @@ namespace MELBOURNE {
|
|
498
498
|
tree = rb_funcall(ptp, rb_sOpAsgnOr, 3, line, var, value);
|
499
499
|
break;
|
500
500
|
}
|
501
|
+
case NODE_OP_CDECL: {
|
502
|
+
VALUE op;
|
503
|
+
VALUE var = process_parse_tree(parser_state, ptp, node->nd_head, locals);
|
504
|
+
VALUE value = process_parse_tree(parser_state, ptp, node->nd_value, locals);
|
505
|
+
switch(node->nd_aid) {
|
506
|
+
case 0:
|
507
|
+
op = ID2SYM(parser_intern("or"));
|
508
|
+
break;
|
509
|
+
case 1:
|
510
|
+
op = ID2SYM(parser_intern("and"));
|
511
|
+
break;
|
512
|
+
default:
|
513
|
+
op = ID2SYM(node->nd_aid);
|
514
|
+
}
|
515
|
+
tree = rb_funcall(ptp, rb_sOpCDecl, 4, line, var, value, op);
|
516
|
+
break;
|
517
|
+
}
|
501
518
|
case NODE_MASGN: {
|
502
519
|
VALUE args = Qnil;
|
503
520
|
|
data/spec/cdecl_spec.rb
CHANGED
@@ -30,4 +30,22 @@ describe "A Cdecl node" do
|
|
30
30
|
[:lasgn, :a, [:const, :Object]],
|
31
31
|
[:cdecl, [:colon2, [:lvar, :a], :B], [:call, nil, :b, [:arglist]]]]
|
32
32
|
end
|
33
|
+
|
34
|
+
parse "X::Y ||= 1" do
|
35
|
+
[:cdecl,
|
36
|
+
[:colon2, [:const, :X], :Y],
|
37
|
+
[:or, [:colon2, [:const, :X], :Y], [:lit, 1]]]
|
38
|
+
end
|
39
|
+
|
40
|
+
parse "X::Y &&= 1" do
|
41
|
+
[:cdecl,
|
42
|
+
[:colon2, [:const, :X], :Y],
|
43
|
+
[:and, [:colon2, [:const, :X], :Y], [:lit, 1]]]
|
44
|
+
end
|
45
|
+
|
46
|
+
parse "X::Y += 1" do
|
47
|
+
[:cdecl,
|
48
|
+
[:colon2, [:const, :X], :Y],
|
49
|
+
[:call, [:colon2, [:const, :X], :Y], :+, [:arglist, [:lit, 1]]]]
|
50
|
+
end
|
33
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubinius-melbourne
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0.0
|
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-
|
11
|
+
date: 2014-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubinius-processor
|