rubinius-ast 2.0.10 → 2.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/lib/rubinius/ast/control_flow.rb +5 -1
- data/lib/rubinius/ast/exceptions.rb +11 -4
- data/lib/rubinius/ast/literals.rb +6 -0
- data/lib/rubinius/ast/operators.rb +16 -2
- data/lib/rubinius/ast/sends.rb +17 -9
- data/lib/rubinius/ast/variables.rb +10 -4
- data/lib/rubinius/ast/version.rb +1 -1
- metadata +45 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
514
|
-
|
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)
|
@@ -221,7 +221,14 @@ module Rubinius::ToolSet.current::TS
|
|
221
221
|
|
222
222
|
def to_sexp
|
223
223
|
arguments = [:arglist] + @arguments.to_sexp
|
224
|
-
|
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
|
-
|
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
|
data/lib/rubinius/ast/sends.rb
CHANGED
@@ -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
|
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
|
-
|
123
|
-
|
124
|
-
|
119
|
+
n, x, b = @block.to_sexp
|
120
|
+
xs = @receiver.to_sexp
|
121
|
+
[n, x, xs, b]
|
125
122
|
else
|
126
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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]
|
data/lib/rubinius/ast/version.rb
CHANGED
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.
|
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
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
23
|
-
requirements:
|
24
|
-
- -
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version:
|
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
|
-
|
37
|
-
requirements:
|
38
|
-
- -
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version:
|
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
|
-
|
48
|
-
|
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
|
-
|
75
|
+
|
76
|
+
require_paths:
|
79
77
|
- lib
|
80
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
-
requirements:
|
82
|
-
-
|
83
|
-
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
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.
|
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
|
-
|
95
|
+
|