rubinius-ast 2.0.10 → 2.0.11

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
- ---
2
- SHA1:
3
- metadata.gz: 6c813e2d9aab238e0539b24b9e8a99577df03d18
4
- data.tar.gz: 05a46ba5bc2c13e3e05a0f9ee715405c33a8fca5
5
- SHA512:
6
- metadata.gz: 83fd6bb2b4515527473abb408e5c6be2ae809d3aa1c9191234f1b242927c5f42fcf680afb2f05fcf68c895d5d90b9a495681ce8344fceac9b89d1ca0fb4adef1
7
- data.tar.gz: b7e29a91fc198d7bfc0e23373b3f4ed8f8da28bbd76d514dcca2b8df05c3629ed2416a67fb15b1bbcf2474b27900d29cc59a40e98370097154349c96c696b665
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 13b07db1a174109a85371ff4bb970022d1da2609
4
+ data.tar.gz: 19c959ab30fa989682ea04b38af56544e7b66ef5
5
+ SHA512:
6
+ metadata.gz: f8fd2fb2d25c37da961ae9489a86e220e2623a161e9d99834a1e88bee31fd3b5062940a2cc46ffaa73e05d962b95bdd4b32168abf0d749d051a706132f896c8c
7
+ data.tar.gz: 8340b99e01eddfd2956eed6401210bcd6fce86d71c4d16d9dc404dfbfeb745487df2e3608554aa22c6d862d69208717625ffc1d76dd1c24f8fe03cfc8e23985a
@@ -39,7 +39,7 @@ module Rubinius::ToolSet.current::TS
39
39
  def to_sexp
40
40
  else_sexp = @else.kind_of?(NilLiteral) ? nil : @else.to_sexp
41
41
  sexp = [:case, receiver_sexp]
42
- sexp << [:whens] + @whens.map { |x| x.to_sexp }
42
+ sexp += @whens.map { |x| x.to_sexp }
43
43
  sexp << else_sexp
44
44
  sexp
45
45
  end
@@ -542,6 +542,10 @@ module Rubinius::ToolSet.current::TS
542
542
  @value = expr || NilLiteral.new(line)
543
543
  end
544
544
 
545
+ def block=(node)
546
+ @value.block = node if @value
547
+ end
548
+
545
549
  def jump_error(g, name)
546
550
  g.push_rubinius
547
551
  g.push_literal name
@@ -392,7 +392,7 @@ module Rubinius::ToolSet.current::TS
392
392
  case body
393
393
  when Block
394
394
  @assignment = body.array.shift if assignment? body.array.first
395
- @body = body
395
+ @body = body.array.size == 1 ? body.array.first : body
396
396
  when nil
397
397
  @body = NilLiteral.new line
398
398
  else
@@ -510,11 +510,18 @@ module Rubinius::ToolSet.current::TS
510
510
  end
511
511
 
512
512
  def to_sexp
513
- array = @conditions.to_sexp
514
- array << @assignment.to_sexp if @assignment
513
+ sexp = [:resbody]
514
+
515
+ if @conditions
516
+ array = @conditions.to_sexp
517
+ sexp << array
518
+ else
519
+ array = sexp
520
+ end
521
+
515
522
  array << @splat.to_sexp if @splat
523
+ array << @assignment.to_sexp if @assignment
516
524
 
517
- sexp = [:resbody, array]
518
525
  case @body
519
526
  when Block
520
527
  sexp << (@body ? @body.array.map { |x| x.to_sexp } : nil)
@@ -499,6 +499,12 @@ module Rubinius::ToolSet.current::TS
499
499
  def sexp_name
500
500
  :dregx
501
501
  end
502
+
503
+ def to_sexp
504
+ sexp = super
505
+ sexp << @options if @options != 0
506
+ sexp
507
+ end
502
508
  end
503
509
 
504
510
  class DynamicOnceRegex < DynamicRegex
@@ -221,7 +221,14 @@ module Rubinius::ToolSet.current::TS
221
221
 
222
222
  def to_sexp
223
223
  arguments = [:arglist] + @arguments.to_sexp
224
- op = @op == :or ? :"||" : :"&&"
224
+ case @op
225
+ when :or
226
+ op = :"||"
227
+ when :and
228
+ op = :"&&"
229
+ else
230
+ op = @op
231
+ end
225
232
  [:op_asgn1, @receiver.to_sexp, arguments, op, @value.to_sexp]
226
233
  end
227
234
  end
@@ -299,7 +306,14 @@ module Rubinius::ToolSet.current::TS
299
306
  end
300
307
 
301
308
  def to_sexp
302
- op = @op == :or ? :"||" : :"&&"
309
+ case @op
310
+ when :or
311
+ op = :"||"
312
+ when :and
313
+ op = :"&&"
314
+ else
315
+ op = @op
316
+ end
303
317
  [:op_asgn2, @receiver.to_sexp, :"#{@name}=", op, @value.to_sexp]
304
318
  end
305
319
  end
@@ -108,22 +108,19 @@ module Rubinius::ToolSet.current::TS
108
108
  end
109
109
 
110
110
  def arguments_sexp
111
- return nil if @vcall_style
112
-
113
111
  sexp = [:arglist]
114
- sexp << @block.to_sexp if @block.kind_of? BlockPass
112
+ sexp << @block.to_sexp if @block
115
113
  sexp
116
114
  end
117
115
 
118
116
  def to_sexp
119
- sexp = [sexp_name, receiver_sexp, @name, arguments_sexp]
120
117
  case @block
121
118
  when For
122
- @block.to_sexp.insert 1, @receiver.to_sexp
123
- when Iter
124
- @block.to_sexp.insert 1, sexp
119
+ n, x, b = @block.to_sexp
120
+ xs = @receiver.to_sexp
121
+ [n, x, xs, b]
125
122
  else
126
- sexp
123
+ [sexp_name, receiver_sexp, @name, arguments_sexp]
127
124
  end
128
125
  end
129
126
  end
@@ -863,6 +860,10 @@ module Rubinius::ToolSet.current::TS
863
860
  def splat_index
864
861
  @splat
865
862
  end
863
+
864
+ def to_sexp
865
+ @arguments.to_sexp
866
+ end
866
867
  end
867
868
 
868
869
  class For19 < For
@@ -1008,7 +1009,14 @@ module Rubinius::ToolSet.current::TS
1008
1009
  end
1009
1010
 
1010
1011
  def to_sexp
1011
- arguments_sexp :yield
1012
+ args = @arguments.to_sexp
1013
+ args << @block.to_sexp if @block
1014
+ if @argument_count == 1 and !@yield_splat and @arguments.splat.nil? and
1015
+ @arguments.array.first.kind_of? SplatValue
1016
+ [:yield, [:array] + args]
1017
+ else
1018
+ [:yield] + args
1019
+ end
1012
1020
  end
1013
1021
  end
1014
1022
 
@@ -356,7 +356,7 @@ module Rubinius::ToolSet.current::TS
356
356
  end
357
357
 
358
358
  def to_sexp
359
- [:splat_assign, @value.to_sexp]
359
+ @value.to_sexp
360
360
  end
361
361
  end
362
362
 
@@ -376,7 +376,7 @@ module Rubinius::ToolSet.current::TS
376
376
  end
377
377
 
378
378
  def to_sexp
379
- [:splat, @value.to_sexp]
379
+ @value.to_sexp
380
380
  end
381
381
  end
382
382
 
@@ -399,7 +399,7 @@ module Rubinius::ToolSet.current::TS
399
399
  end
400
400
 
401
401
  def to_sexp
402
- [:splat, @value.to_sexp]
402
+ @value.to_sexp
403
403
  end
404
404
  end
405
405
 
@@ -733,7 +733,13 @@ module Rubinius::ToolSet.current::TS
733
733
 
734
734
  def to_sexp
735
735
  left = @left ? @left.to_sexp : [:array]
736
- left << [:splat, @splat.to_sexp] if @splat
736
+ case @splat
737
+ when EmptySplat
738
+ left << [:splat]
739
+ when nil
740
+ else
741
+ left << [:splat, @splat.to_sexp]
742
+ end
737
743
  left << @block.to_sexp if @block
738
744
 
739
745
  sexp = [:masgn, left]
@@ -1,5 +1,5 @@
1
1
  module Rubinius::ToolSet.current::TS
2
2
  module AST
3
- VERSION = "2.0.10"
3
+ VERSION = "2.0.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,51 +1,47 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rubinius-ast
3
- version: !ruby/object:Gem::Version
4
- version: 2.0.10
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.11
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Brian Shirai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-07 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
11
+
12
+ date: 2014-01-07 00:00:00 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.3'
20
- type: :development
21
16
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.3'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '10.0'
17
+ requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: "1.3"
34
22
  type: :development
23
+ version_requirements: *id001
24
+ - !ruby/object:Gem::Dependency
25
+ name: rake
35
26
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '10.0'
27
+ requirement: &id002 !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ~>
30
+ - !ruby/object:Gem::Version
31
+ version: "10.0"
32
+ type: :development
33
+ version_requirements: *id002
41
34
  description: An Abstract Syntax Tree for Ruby.
42
- email:
35
+ email:
43
36
  - brixen@gmail.com
44
37
  executables: []
38
+
45
39
  extensions: []
40
+
46
41
  extra_rdoc_files: []
47
- files:
48
- - ".gitignore"
42
+
43
+ files:
44
+ - .gitignore
49
45
  - Gemfile
50
46
  - LICENSE
51
47
  - README.md
@@ -70,28 +66,30 @@ files:
70
66
  - lib/rubinius/ast/version.rb
71
67
  - rubinius-ast.gemspec
72
68
  homepage: https://github.com/rubinius/rubinius-ast
73
- licenses:
69
+ licenses:
74
70
  - BSD
75
71
  metadata: {}
72
+
76
73
  post_install_message:
77
74
  rdoc_options: []
78
- require_paths:
75
+
76
+ require_paths:
79
77
  - lib
80
- required_ruby_version: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- version: '0'
85
- required_rubygems_version: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - &id003
81
+ - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: "0"
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - *id003
90
87
  requirements: []
88
+
91
89
  rubyforge_project:
92
- rubygems_version: 2.0.7
90
+ rubygems_version: 2.1.10
93
91
  signing_key:
94
92
  specification_version: 4
95
93
  summary: An Abstract Syntax Tree for Ruby.
96
94
  test_files: []
97
- has_rdoc:
95
+