rubinius-ast 1.2.1 → 1.3.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: 91409a26aa4135352fb1e50a67a5952c7e8bfcca
4
- data.tar.gz: 8d5c8f3ea2def5e0c6214e0678d9aac81a205ff5
3
+ metadata.gz: 8a80878e26807379f1033812a3b4696f07acdff5
4
+ data.tar.gz: 4ed3c3310f69aa17f6115d113a7c8dfb2b540b72
5
5
  SHA512:
6
- metadata.gz: b33a2f0f6358b5e87808135050401046843999e168b4e35115d3a9d0cd3853b86c0e99615032002548f555d0cead76f2d140755bebbd2a358233287808372241
7
- data.tar.gz: 5a2d6b73f476c7337b31406bd9999d6402378937ff713a2748b31c089076d2c66d618ba125cdfc078b1f0bcb35dbc6714a27213f1cff218e9649b7a28ea57690
6
+ metadata.gz: 208fd3f1cdfd68adf2f82695c8012b9c0806e56b68ef1730049d2489298299be8f78ba0a14775b067ad6535fa0f1d7d40f9305bbaa6a7c92d14ec7142411c05c
7
+ data.tar.gz: 7e4f788c9b910342ab1a170ab47b3df0a14f2e17a21eb8a56b7a2d7590f0bf7841e46fb6af625cce69d1051bcdd4d3f6940d500e227c689330b307d1fe5effb5
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
 
6
6
  class TypeConstant < Node
@@ -204,7 +204,8 @@ module Rubinius::ToolSets.current::ToolSet
204
204
  pos(g)
205
205
 
206
206
  if g.state.op_asgn?
207
- g.push_literal Compiler::Runtime
207
+ g.push_rubinius
208
+ g.find_const :Runtime
208
209
  g.push_literal @name
209
210
  g.push_scope
210
211
  g.send :find_constant_for_op_asign_or, 2
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class Case < Node
6
6
  attr_accessor :whens, :else
@@ -209,7 +209,8 @@ module Rubinius::ToolSets.current::ToolSet
209
209
  g.dup
210
210
  @condition.bytecode(g)
211
211
  g.cast_array
212
- g.push_literal Compiler::Runtime
212
+ g.push_rubinius
213
+ g.find_const :Runtime
213
214
  g.rotate(3)
214
215
  g.send :matches_when, 2
215
216
  g.git body
@@ -271,14 +272,16 @@ module Rubinius::ToolSets.current::ToolSet
271
272
  end
272
273
 
273
274
  def get_flip_flop(g, index)
274
- g.push_literal Compiler::Runtime
275
+ g.push_rubinius
276
+ g.find_const :Runtime
275
277
  g.push_scope
276
278
  g.push_literal index
277
279
  g.send(:get_flip_flop, 2)
278
280
  end
279
281
 
280
282
  def set_flip_flop(g, index, value)
281
- g.push_literal Compiler::Runtime
283
+ g.push_rubinius
284
+ g.find_const :Runtime
282
285
  g.push_scope
283
286
  g.push_literal index
284
287
  g.push_literal value
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class EndData < Node
6
6
  attr_accessor :data
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class Alias < Node
6
6
  attr_accessor :to, :from
@@ -330,7 +330,15 @@ module Rubinius::ToolSets.current::ToolSet
330
330
  @required.size
331
331
  end
332
332
 
333
- alias_method :arity, :required_args
333
+ def arity
334
+ arity = required_args
335
+
336
+ if @splat or not @optional.empty?
337
+ arity = -(arity + 1)
338
+ end
339
+
340
+ arity
341
+ end
334
342
 
335
343
  def post_args
336
344
  0
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class Encoding < Node
6
6
  attr_accessor :name
@@ -13,7 +13,8 @@ module Rubinius::ToolSets.current::ToolSet
13
13
  def bytecode(g)
14
14
  pos(g)
15
15
 
16
- g.push_literal Compiler::Runtime
16
+ g.push_rubinius
17
+ g.find_const :Runtime
17
18
  g.push_literal @name
18
19
  g.send :get_encoding, 1
19
20
  end
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class Begin < Node
6
6
  attr_accessor :rescue
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class File < Node
6
6
  def bytecode(g)
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class AsciiGrapher
6
6
  def initialize(ast, node_kind=Node)
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class ArrayLiteral < Node
6
6
  attr_accessor :body
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class Node
6
6
  attr_accessor :line
@@ -64,6 +64,7 @@ module Rubinius::ToolSets.current::ToolSet
64
64
  blk.total_args = arguments.total_args
65
65
  blk.splat_index = arguments.splat_index
66
66
  blk.block_index = arguments.block_index
67
+ blk.arity = arguments.arity
67
68
 
68
69
  blk
69
70
  end
@@ -79,6 +80,7 @@ module Rubinius::ToolSets.current::ToolSet
79
80
  meth.total_args = arguments.total_args
80
81
  meth.splat_index = arguments.splat_index
81
82
  meth.block_index = arguments.block_index
83
+ meth.arity = arguments.arity
82
84
  end
83
85
 
84
86
  meth
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class And < Node
6
6
  attr_accessor :left, :right
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class Self < Node
6
6
  def bytecode(g)
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class Send < Node
6
6
  attr_accessor :receiver, :name, :privately, :block, :variable, :vcall_style
@@ -264,7 +264,8 @@ module Rubinius::ToolSets.current::ToolSet
264
264
  g.push_state ClosedScope.new(@line)
265
265
  g.state.push_name :BEGIN
266
266
 
267
- g.push_literal Compiler::Runtime
267
+ g.push_rubinius
268
+ g.find_const :Runtime
268
269
  @block.bytecode(g)
269
270
  g.send_with_block :pre_exe, 0, false
270
271
 
@@ -836,7 +837,8 @@ module Rubinius::ToolSets.current::ToolSet
836
837
 
837
838
  def bytecode(g)
838
839
  if @splat
839
- g.push_literal Compiler::Runtime
840
+ g.push_rubinius
841
+ g.find_const :Runtime
840
842
  g.push_local 0
841
843
  g.send :unwrap_block_arg, 1
842
844
  else
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  module Transforms
6
6
  def self.register(category, name, klass)
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class SplatValue < Node
6
6
  attr_accessor :value
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: us-ascii -*-
2
2
 
3
- module Rubinius::ToolSets.current::ToolSet
3
+ module CodeTools
4
4
  module AST
5
5
  class BackRef < Node
6
6
  attr_accessor :kind
@@ -1,5 +1,5 @@
1
- module Rubinius::ToolSets.current::ToolSet
1
+ module CodeTools
2
2
  module AST
3
- VERSION = "1.2.1"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
data/rubinius-ast.gemspec CHANGED
@@ -1,10 +1,9 @@
1
1
  # coding: utf-8
2
- require 'rubinius/toolset'
3
2
  require './lib/rubinius/ast/version'
4
3
 
5
4
  Gem::Specification.new do |spec|
6
5
  spec.name = "rubinius-ast"
7
- spec.version = Rubinius::ToolSets.current::ToolSet::AST::VERSION
6
+ spec.version = CodeTools::AST::VERSION
8
7
  spec.authors = ["Brian Shirai"]
9
8
  spec.email = ["brixen@gmail.com"]
10
9
  spec.description = %q{An Abstract Syntax Tree for Ruby.}
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubinius-ast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.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-23 00:00:00.000000000 Z
11
+ date: 2014-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
- version_requirements: !ruby/object:Gem::Requirement
15
+ requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
- requirement: !ruby/object:Gem::Requirement
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
22
23
  requirements:
23
24
  - - "~>"
24
25
  - !ruby/object:Gem::Version
25
26
  version: '1.3'
26
- prerelease: false
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
- version_requirements: !ruby/object:Gem::Requirement
29
+ requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
- requirement: !ruby/object:Gem::Requirement
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
36
37
  requirements:
37
38
  - - "~>"
38
39
  - !ruby/object:Gem::Version
39
40
  version: '10.0'
40
- prerelease: false
41
41
  description: An Abstract Syntax Tree for Ruby.
42
42
  email:
43
43
  - brixen@gmail.com
@@ -94,4 +94,3 @@ signing_key:
94
94
  specification_version: 4
95
95
  summary: An Abstract Syntax Tree for Ruby.
96
96
  test_files: []
97
- has_rdoc: