rubinius-ast 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 446fcd824eee49fa15042e4aa39a3e802b49a4bb
4
- data.tar.gz: b89a58a16a0ccacf3ac5e638fd29b2cefc2d5472
3
+ metadata.gz: 6b308177a6c0ff0e59008708b3f6529b2f936276
4
+ data.tar.gz: c28077607c79e0ad5e2a9f94418fde55a0794213
5
5
  SHA512:
6
- metadata.gz: 625a245f3487f621f66419640e446a00e4046318ec505a123c80ee27186b803f1d01f5635ae7884134cba19625e3d36468bd87348ab930fb69820706031a725d
7
- data.tar.gz: 9ad09df099f4f9bc70476b71d144972186b0fcf8a194cb092b4af4c956609321fd3be6ca55d398a93f79e84dc289cf688efee67d33cf9cdfbed03020e4d38f7a
6
+ metadata.gz: 32249255741774d05b8b6db66318d9b6638595b4b7c9958c24c6ef70d857c3457c6aaa342c339e29c05f88ddd423d3e05a3dbdc3f17f0f38b30809e3cc0ae868
7
+ data.tar.gz: 479dde2dbcac922b17fbd378b3a953f5a95e32239d938658fb9161351ef403ce7554f069ae0231fa3ffaea0f7beb1839dd003131b6b7508ab9e53cf3814f5515
@@ -589,7 +589,7 @@ module CodeTools
589
589
  @names = array.map { |a| a.name }
590
590
 
591
591
  array.each do |arg|
592
- if arg.value.value == :*
592
+ if arg.value.kind_of?(SymbolLiteral) and arg.value.value == :*
593
593
  @required << arg
594
594
  else
595
595
  @defaults << arg
@@ -257,7 +257,15 @@ module CodeTools
257
257
  end
258
258
 
259
259
  def to_sexp
260
- arguments = [:arglist] + @arguments.to_sexp
260
+ arguments = [:arglist]
261
+
262
+ case @arguments
263
+ when PushArguments
264
+ arguments << @arguments.to_sexp
265
+ else
266
+ arguments += @arguments.to_sexp
267
+ end
268
+
261
269
  case @op
262
270
  when :or
263
271
  op = :"||"
@@ -152,7 +152,15 @@ module CodeTools
152
152
  end
153
153
 
154
154
  def arguments_sexp(name=:arglist)
155
- sexp = [name] + @arguments.to_sexp
155
+ sexp = [name]
156
+
157
+ case @arguments
158
+ when PushArguments
159
+ sexp << @arguments.to_sexp
160
+ else
161
+ sexp += @arguments.to_sexp
162
+ end
163
+
156
164
  sexp << @block.to_sexp if @block
157
165
  sexp
158
166
  end
@@ -868,6 +876,26 @@ module CodeTools
868
876
  @assignments.bytecode(g)
869
877
  g.state.pop_masgn
870
878
  end
879
+
880
+ def to_sexp
881
+ sexp = [:args]
882
+
883
+ case @assignments
884
+ when ArrayLiteral
885
+ @assignments.each do |a|
886
+ case a
887
+ when Symbol
888
+ sexp << a
889
+ when Node
890
+ sexp << a.to_sexp
891
+ end
892
+ end
893
+ else
894
+ sexp << @assignments.to_sexp
895
+ end
896
+
897
+ sexp
898
+ end
871
899
  end
872
900
 
873
901
  class Negate < Node
@@ -1,5 +1,5 @@
1
1
  module CodeTools
2
2
  module AST
3
- VERSION = "2.2.0"
3
+ VERSION = "2.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubinius-ast
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Shirai