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 +4 -4
- data/lib/rubinius/ast/constants.rb +3 -2
- data/lib/rubinius/ast/control_flow.rb +7 -4
- data/lib/rubinius/ast/data.rb +1 -1
- data/lib/rubinius/ast/definitions.rb +10 -2
- data/lib/rubinius/ast/encoding.rb +3 -2
- data/lib/rubinius/ast/exceptions.rb +1 -1
- data/lib/rubinius/ast/file.rb +1 -1
- data/lib/rubinius/ast/grapher.rb +1 -1
- data/lib/rubinius/ast/literals.rb +1 -1
- data/lib/rubinius/ast/node.rb +3 -1
- data/lib/rubinius/ast/operators.rb +1 -1
- data/lib/rubinius/ast/self.rb +1 -1
- data/lib/rubinius/ast/sends.rb +5 -3
- data/lib/rubinius/ast/transforms.rb +1 -1
- data/lib/rubinius/ast/values.rb +1 -1
- data/lib/rubinius/ast/variables.rb +1 -1
- data/lib/rubinius/ast/version.rb +2 -2
- data/rubinius-ast.gemspec +1 -2
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a80878e26807379f1033812a3b4696f07acdff5
|
4
|
+
data.tar.gz: 4ed3c3310f69aa17f6115d113a7c8dfb2b540b72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 208fd3f1cdfd68adf2f82695c8012b9c0806e56b68ef1730049d2489298299be8f78ba0a14775b067ad6535fa0f1d7d40f9305bbaa6a7c92d14ec7142411c05c
|
7
|
+
data.tar.gz: 7e4f788c9b910342ab1a170ab47b3df0a14f2e17a21eb8a56b7a2d7590f0bf7841e46fb6af625cce69d1051bcdd4d3f6940d500e227c689330b307d1fe5effb5
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: us-ascii -*-
|
2
2
|
|
3
|
-
module
|
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.
|
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
|
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.
|
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.
|
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.
|
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
|
data/lib/rubinius/ast/data.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: us-ascii -*-
|
2
2
|
|
3
|
-
module
|
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
|
-
|
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
|
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.
|
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
|
data/lib/rubinius/ast/file.rb
CHANGED
data/lib/rubinius/ast/grapher.rb
CHANGED
data/lib/rubinius/ast/node.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: us-ascii -*-
|
2
2
|
|
3
|
-
module
|
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
|
data/lib/rubinius/ast/self.rb
CHANGED
data/lib/rubinius/ast/sends.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: us-ascii -*-
|
2
2
|
|
3
|
-
module
|
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.
|
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.
|
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
|
data/lib/rubinius/ast/values.rb
CHANGED
data/lib/rubinius/ast/version.rb
CHANGED
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 =
|
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.
|
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-
|
11
|
+
date: 2014-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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:
|