rubinius-ast 3.5 → 3.6

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: c75c337e4e65b87670e62183252530329118d091
4
- data.tar.gz: 640f7537ad2d01958c38a42c50e24683b7b389bc
3
+ metadata.gz: 03b20e9b3a87699e1b270e481571d3cb3ce36ade
4
+ data.tar.gz: a1e2ab029d36856c39134ebac9b7281db7100941
5
5
  SHA512:
6
- metadata.gz: 9d3537443f9bbbad14036c85a2e041bb58686368605738c662d2d4ee7ec40f1c53aa76612ff2b17b417c931e03e0b3de84e30ff9e0e31f62e981b7c8ad0f01e1
7
- data.tar.gz: 9d6f8ab36a677d7e1bddb00ccafd9d61785b028dbbb4dee51c399a3e66592c3dcc2cddf1bda02d71a04603af519756400e97236c4bb4ddfb44ddd60687731010
6
+ metadata.gz: 06a5d737c90eb84cc1576a9b1400a62e490e721e696c6cf54f8dc05b3a063ec2a33a9518267dd71e9a7fe9c08116fb21e14bbc9986d1e9fd3d1d42acad3e96e5
7
+ data.tar.gz: 1a5b784a46f81f132810f4128b9c8c0890d4ebd255e6ef1f1d7004332426772d9c68cc72015ef963c76fbf4dfdfebc99cd0ad01abeca3dacee5d84ec534df611
@@ -302,7 +302,7 @@ module CodeTools
302
302
  class Parameters < Node
303
303
  attr_accessor :names, :required, :optional, :defaults, :splat,
304
304
  :post, :keywords, :kwrest
305
- attr_reader :block_arg, :block_index
305
+ attr_reader :block_arg, :block_index, :kwrest_index
306
306
 
307
307
  def initialize(line, required=nil, optional=nil, splat=nil,
308
308
  post=nil, kwargs=nil, kwrest=nil, block=nil)
@@ -312,6 +312,7 @@ module CodeTools
312
312
  @block_arg = nil
313
313
  @splat_index = nil
314
314
  @block_index = nil
315
+ @kwrest_index = nil
315
316
  @locals = []
316
317
  @local_index = 0
317
318
 
@@ -360,6 +361,11 @@ module CodeTools
360
361
 
361
362
  @keywords.value = LocalVariableAccess.new line, placeholder_var if @keywords
362
363
 
364
+ if kwrest
365
+ @kwrest_index = total_args + @keywords.arguments.length + 1
366
+ @kwrest_index += 1 if block
367
+ end
368
+
363
369
  @names = names
364
370
 
365
371
  self.block_arg = block
@@ -403,10 +409,7 @@ module CodeTools
403
409
  @block_arg = BlockArgument.new @line, block
404
410
  end
405
411
 
406
- if @locals.last.kind_of? BlockArgument
407
- @block_index -= 1
408
- @locals.pop
409
- end
412
+ @locals.pop if @locals.last.kind_of? BlockArgument
410
413
  @names.pop if @names.last.kind_of? BlockArgument
411
414
 
412
415
  @block_index = @locals.size
@@ -443,12 +446,7 @@ module CodeTools
443
446
 
444
447
  if @splat or not @optional.empty? or
445
448
  (@keywords and not @keywords.required?)
446
- arity += 1
447
- end
448
-
449
- if @splat or not @optional.empty? or
450
- (@keywords and not @keywords.required?)
451
- arity = -arity
449
+ arity = -arity - 1
452
450
  end
453
451
 
454
452
  arity
@@ -66,6 +66,7 @@ module CodeTools
66
66
  blk.block_index = arguments.block_index
67
67
  blk.arity = arguments.arity
68
68
  blk.keywords = arguments.keywords.entries if arguments.keywords
69
+ blk.kwrest_index = arguments.kwrest_index
69
70
 
70
71
  blk
71
72
  end
@@ -83,6 +84,7 @@ module CodeTools
83
84
  meth.block_index = arguments.block_index
84
85
  meth.arity = arguments.arity
85
86
  meth.keywords = arguments.keywords.entries if arguments.keywords
87
+ meth.kwrest_index = arguments.kwrest_index
86
88
  end
87
89
 
88
90
  meth
@@ -622,6 +622,7 @@ module CodeTools
622
622
  blk.pop_state
623
623
 
624
624
  blk.splat_index = @arguments.splat_index
625
+ blk.kwrest_index = @arguments.kwrest_index
625
626
  blk.local_count = local_count
626
627
  blk.local_names = local_names
627
628
 
@@ -643,7 +644,7 @@ module CodeTools
643
644
 
644
645
  class IterArguments < Node
645
646
  attr_accessor :prelude, :arity, :optional, :arguments, :splat_index, :block_index
646
- attr_accessor :required_args, :keywords
647
+ attr_accessor :required_args, :keywords, :kwrest_index
647
648
 
648
649
  def initialize(line, arguments)
649
650
  @line = line
@@ -652,6 +653,7 @@ module CodeTools
652
653
 
653
654
  @splat_index = -1
654
655
  @block_index = nil
656
+ @kwrest_index = nil
655
657
  @required_args = 0
656
658
  @splat = nil
657
659
  @block = nil
@@ -843,7 +845,7 @@ module CodeTools
843
845
 
844
846
  class ForParameters < Node
845
847
  attr_accessor :assignments, :required_args, :splat_index,
846
- :post_args, :keywords, :block_index
848
+ :post_args, :keywords, :block_index, :kwrest_index
847
849
 
848
850
  def initialize(line, assignments)
849
851
  @line = line
@@ -853,6 +855,7 @@ module CodeTools
853
855
  @post_args = 0
854
856
  @keywords = nil
855
857
  @block_index = nil
858
+ @kwrest_index = nil
856
859
  end
857
860
 
858
861
  alias_method :total_args, :required_args
@@ -1,5 +1,5 @@
1
1
  module CodeTools
2
2
  module AST
3
- VERSION = "3.5"
3
+ VERSION = "3.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubinius-ast
3
3
  version: !ruby/object:Gem::Version
4
- version: '3.5'
4
+ version: '3.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Shirai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-30 00:00:00.000000000 Z
11
+ date: 2016-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler