rubinius-ast 3.7 → 3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubinius/code/ast/definitions.rb +39 -0
- data/lib/rubinius/code/ast/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fcd85af7bb6b46d7cc98969f55e3d1f7ca2461f
|
4
|
+
data.tar.gz: f841f69e37c46dbabdec8cc008b3bf0ef9cfe9a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32b46b170eaefa666d06a7dd2489de4e0fc584650eca3f5397a7c4b4607b6d24e458fec4eca3b42fcedb38308bda340a8667097c49c2e6cb5fdcc64dc92d0d76
|
7
|
+
data.tar.gz: 6b4818f6358ada39bebbe7e7036c9f213f11aa335146d0bd132a29894886a74961a8ac09828b18485198bd6ec4b950b50575bc34b6263b40b1e015733476fb0f
|
@@ -185,6 +185,39 @@ module CodeTools
|
|
185
185
|
end
|
186
186
|
end
|
187
187
|
|
188
|
+
class DefineFunction < Node
|
189
|
+
attr_accessor :name, :arguments
|
190
|
+
|
191
|
+
def initialize(line, name, block)
|
192
|
+
@line = line
|
193
|
+
@name = name
|
194
|
+
@arguments = block.extract_parameters
|
195
|
+
block.array << NilLiteral.new(line) if block.array.empty?
|
196
|
+
@body = block
|
197
|
+
end
|
198
|
+
|
199
|
+
def bytecode(g)
|
200
|
+
pos(g)
|
201
|
+
|
202
|
+
g.push_const :Kernel
|
203
|
+
g.push_literal sexp_name.to_s
|
204
|
+
g.push_literal " "
|
205
|
+
g.push_literal @name.to_s
|
206
|
+
g.string_build 3
|
207
|
+
g.send :puts, 1
|
208
|
+
end
|
209
|
+
|
210
|
+
def sexp_name
|
211
|
+
:fun
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
class DefineFunctionMulti < DefineFunction
|
216
|
+
def sexp_name
|
217
|
+
:funm
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
188
221
|
class Define < ClosedScope
|
189
222
|
attr_accessor :name, :arguments
|
190
223
|
|
@@ -238,6 +271,9 @@ module CodeTools
|
|
238
271
|
end
|
239
272
|
end
|
240
273
|
|
274
|
+
class DefineMulti < Define
|
275
|
+
end
|
276
|
+
|
241
277
|
class DefineSingleton < Node
|
242
278
|
attr_accessor :receiver, :body
|
243
279
|
|
@@ -259,6 +295,9 @@ module CodeTools
|
|
259
295
|
end
|
260
296
|
end
|
261
297
|
|
298
|
+
class DefineSingletonMulti < DefineSingleton
|
299
|
+
end
|
300
|
+
|
262
301
|
class DefineSingletonScope < Define
|
263
302
|
def initialize(line, name, block)
|
264
303
|
super line, name, block
|
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.
|
4
|
+
version: '3.8'
|
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-07-
|
11
|
+
date: 2016-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|