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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba4c017c57885cec1212ad04403b47343bdf8490
4
- data.tar.gz: e3387799366025acba4b8af8a89ad076627dd1e9
3
+ metadata.gz: eac46b199e3ca8e71fc0016f67ca06b5b69884b2
4
+ data.tar.gz: 0f9dc4c9bc85d5d2c381571b6bf837f6d4b1470f
5
5
  SHA512:
6
- metadata.gz: 1a4310ce6107ff36f49ef42c5abbf7f9e7e20567e6ff48ecfe59d311226269a7ea63a4c8d1761825a98e2a5bda9618e02bdf5349a0f3ff5000c7c04e1285b526
7
- data.tar.gz: a798063f95c28ab65f487a3fb79746b4038a1da258f5bb5caee6bf6af162416993a3510b22c48b23a8dd089c94a74caa4c78dc73ab03909bf6dd666eb8fea277
6
+ metadata.gz: 2b32b151e38cd5bf8af7c214b8afde1aba30bc564d115ae67854e6b5858e3e95fa13e2b4a80d783e510fcd20521aa79bead9850c4a1c5a92715196dfb3697c96
7
+ data.tar.gz: ec446e0a9512dcd725cbb8731f28015bf83e0dc6b0c826bf3a3694fb86cde45b33dfb6f36ba9425b6d837cca2e3f5aaa5e88f53861eafde5f2f0be37feaba8cc
data/Rakefile CHANGED
@@ -34,6 +34,7 @@ end
34
34
 
35
35
  desc "Run the specs"
36
36
  task :spec => %w[spec:clean spec:build] do
37
+ ENV['RUBYLIB'] ||= "#{File.join(__dir__, 'lib')}:#{__dir__}"
37
38
  sh "mspec -r spec/spec_helper spec"
38
39
  end
39
40
 
@@ -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");
@@ -79,6 +79,7 @@ namespace MELBOURNE {
79
79
  extern ID rb_sOpAsgn2;
80
80
  extern ID rb_sOpAsgnAnd;
81
81
  extern ID rb_sOpAsgnOr;
82
+ extern ID rb_sOpCDecl;
82
83
  extern ID rb_sOptArg;
83
84
  extern ID rb_sOr;
84
85
  extern ID rb_sPostExe;
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  module CodeTools
2
2
  class Melbourne
3
- VERSION = "2.2.2.0"
3
+ VERSION = "2.3.0.0"
4
4
  end
5
5
  end
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.2.2.0
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-06-24 00:00:00.000000000 Z
11
+ date: 2014-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubinius-processor