rubinius-ast 3.15 → 3.16
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 +32 -8
- data/lib/rubinius/code/ast/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b35a8d42ecaadc5079f0c2fab33ae04f8a72c54
|
4
|
+
data.tar.gz: 4b472ed53ba2baa4d4cf976f2eafaea9e6f493fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e4b9effcdab32cc9d99f587683d08fea3cb1130a30785ac9e7a05c790ab43448568606e7f532b8317a26181e5c2ac8a3bd9233940254099f6a6696b5f234fe6
|
7
|
+
data.tar.gz: 01bf970764aebabdd356f7f5cd8e0879038aec061aa406daf05ba940775a0fe216fa1a42f5049c37c4e552a4022eef3ae8344d5bb62f08ee89074a6c508a3bac
|
@@ -185,7 +185,7 @@ module CodeTools
|
|
185
185
|
end
|
186
186
|
end
|
187
187
|
|
188
|
-
class DefineFunction <
|
188
|
+
class DefineFunction < ClosedScope
|
189
189
|
attr_accessor :name, :arguments
|
190
190
|
|
191
191
|
def initialize(line, name, block)
|
@@ -196,19 +196,43 @@ module CodeTools
|
|
196
196
|
@body = block
|
197
197
|
end
|
198
198
|
|
199
|
+
def compile_body(g)
|
200
|
+
function = new_generator(g, @name, @arguments)
|
201
|
+
|
202
|
+
function.push_state self
|
203
|
+
function.state.push_super self
|
204
|
+
function.definition_line(@line)
|
205
|
+
|
206
|
+
function.state.push_name @name
|
207
|
+
|
208
|
+
@arguments.bytecode(function)
|
209
|
+
@body.bytecode(function)
|
210
|
+
|
211
|
+
function.state.pop_name
|
212
|
+
|
213
|
+
function.local_count = local_count
|
214
|
+
function.local_names = local_names
|
215
|
+
|
216
|
+
function.ret
|
217
|
+
function.close
|
218
|
+
function.pop_state
|
219
|
+
|
220
|
+
return function
|
221
|
+
end
|
222
|
+
|
199
223
|
def bytecode(g)
|
200
224
|
pos(g)
|
201
225
|
|
202
|
-
g.
|
203
|
-
g.push_literal
|
204
|
-
g.
|
205
|
-
g.
|
206
|
-
|
207
|
-
g.send :
|
226
|
+
g.push_rubinius
|
227
|
+
g.push_literal @name
|
228
|
+
g.push_generator compile_body(g)
|
229
|
+
g.push_scope
|
230
|
+
|
231
|
+
g.send :add_function, 3
|
208
232
|
end
|
209
233
|
|
210
234
|
def sexp_name
|
211
|
-
:fun
|
235
|
+
[:fun, @name, @arguments.to_sexp, [:scope, @body.to_sexp]]
|
212
236
|
end
|
213
237
|
end
|
214
238
|
|
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.16'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Shirai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
85
|
rubyforge_project:
|
86
|
-
rubygems_version: 2.5.
|
86
|
+
rubygems_version: 2.5.2.3
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: An Abstract Syntax Tree for the Rubinius language platform.
|