rubinius-processor 2.1.2 → 2.2.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/processor/processor.rb +24 -16
- data/lib/rubinius/processor/version.rb +2 -2
- data/rubinius-processor.gemspec +1 -2
- 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: 9231aec8f1baaa933328986654a229564e4f7ea0
|
4
|
+
data.tar.gz: d0457344b6e06b21f61c408b23b77e27a63a08f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2e258836bcc6cd1aa9d89a5565a2ddefe0143b5d76a06b29741439c38384dd9e69bb941832cf05a1f9d1e950e526f829802a8fbcd2f7b8bf8d9df9df29d3925
|
7
|
+
data.tar.gz: d26c6b2825a75babb6da218a32d67fded9f9cdf614098bcfd14acbdf61601b41bd1e317a2934b1e6a2e865dd15f6bde41232f99945d070c82b96d20a7f277e9c
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module CodeTools
|
2
2
|
# TODO: This will change to:
|
3
3
|
# class Processor
|
4
4
|
class Melbourne
|
@@ -34,8 +34,8 @@ module Rubinius::ToolSets.current::ToolSet
|
|
34
34
|
AST::And.new line, left, right
|
35
35
|
end
|
36
36
|
|
37
|
-
def process_args(line, required, optional, splat, post, block)
|
38
|
-
AST::
|
37
|
+
def process_args(line, required, optional, splat, post, kwargs, kwrest, block)
|
38
|
+
AST::Parameters.new line, required, optional, splat, post, kwargs, kwrest, block
|
39
39
|
end
|
40
40
|
|
41
41
|
def process_argscat(line, array, rest)
|
@@ -270,7 +270,7 @@ module Rubinius::ToolSets.current::ToolSet
|
|
270
270
|
|
271
271
|
def process_for(line, iter, arguments, body)
|
272
272
|
send = AST::Send.new line, iter, :each
|
273
|
-
send.block = AST::
|
273
|
+
send.block = AST::For.new line, arguments, body
|
274
274
|
send
|
275
275
|
end
|
276
276
|
|
@@ -294,16 +294,20 @@ module Rubinius::ToolSets.current::ToolSet
|
|
294
294
|
AST::If.new line, cond, body, else_body
|
295
295
|
end
|
296
296
|
|
297
|
+
def process_imaginary(line, value)
|
298
|
+
AST::ImaginaryLiteral.new line, value
|
299
|
+
end
|
300
|
+
|
297
301
|
def process_iter(line, method_send, scope)
|
298
302
|
ary = scope && scope.array || []
|
299
303
|
arguments = nil
|
300
304
|
|
301
|
-
if ary.first.kind_of? AST::
|
305
|
+
if ary.first.kind_of? AST::Parameters
|
302
306
|
arguments = scope.array.shift
|
303
307
|
end
|
304
308
|
|
305
309
|
unless arguments
|
306
|
-
arguments = AST::
|
310
|
+
arguments = AST::Parameters.new line
|
307
311
|
end
|
308
312
|
|
309
313
|
case ary.size
|
@@ -319,7 +323,7 @@ module Rubinius::ToolSets.current::ToolSet
|
|
319
323
|
body = scope
|
320
324
|
end
|
321
325
|
|
322
|
-
method_send.block = AST::
|
326
|
+
method_send.block = AST::Iter.new line, arguments, body
|
323
327
|
method_send
|
324
328
|
end
|
325
329
|
|
@@ -327,6 +331,10 @@ module Rubinius::ToolSets.current::ToolSet
|
|
327
331
|
AST::InstanceVariableAccess.new line, name
|
328
332
|
end
|
329
333
|
|
334
|
+
def process_kw_arg(line, arguments)
|
335
|
+
AST::Block.new line, arguments
|
336
|
+
end
|
337
|
+
|
330
338
|
def process_lambda(line, scope)
|
331
339
|
arguments = scope.array.shift
|
332
340
|
if scope.array.size == 1
|
@@ -335,11 +343,7 @@ module Rubinius::ToolSets.current::ToolSet
|
|
335
343
|
body = scope
|
336
344
|
end
|
337
345
|
|
338
|
-
|
339
|
-
method_send = AST::Send.new line, receiver, :lambda, true
|
340
|
-
|
341
|
-
method_send.block = AST::Iter19.new line, arguments, body
|
342
|
-
method_send
|
346
|
+
AST::Lambda.new line, arguments, body
|
343
347
|
end
|
344
348
|
|
345
349
|
|
@@ -405,11 +409,11 @@ module Rubinius::ToolSets.current::ToolSet
|
|
405
409
|
end
|
406
410
|
|
407
411
|
def process_op_asgn1(line, receiver, index, op, value)
|
408
|
-
AST::
|
412
|
+
AST::OpAssignElement.new line, receiver, index, op, value
|
409
413
|
end
|
410
414
|
|
411
415
|
def process_op_asgn2(line, receiver, name, op, value)
|
412
|
-
AST::
|
416
|
+
AST::OpAssignAttribute.new line, receiver, name, op, value
|
413
417
|
end
|
414
418
|
|
415
419
|
def process_op_asgn_and(line, var, value)
|
@@ -417,7 +421,7 @@ module Rubinius::ToolSets.current::ToolSet
|
|
417
421
|
end
|
418
422
|
|
419
423
|
def process_op_asgn_or(line, var, value)
|
420
|
-
AST::
|
424
|
+
AST::OpAssignOr.new line, var, value
|
421
425
|
end
|
422
426
|
|
423
427
|
def process_opt_arg(line, arguments)
|
@@ -440,11 +444,15 @@ module Rubinius::ToolSets.current::ToolSet
|
|
440
444
|
|
441
445
|
def process_preexe(line, body)
|
442
446
|
node = AST::PreExe19.new line
|
443
|
-
node.block = AST::
|
447
|
+
node.block = AST::Iter.new line, nil, body
|
444
448
|
add_pre_exe node
|
445
449
|
node
|
446
450
|
end
|
447
451
|
|
452
|
+
def process_rational(line, value)
|
453
|
+
AST::RationalLiteral.new line, value
|
454
|
+
end
|
455
|
+
|
448
456
|
def process_redo(line)
|
449
457
|
AST::Redo.new line
|
450
458
|
end
|
data/rubinius-processor.gemspec
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
require 'rubinius/toolset'
|
3
2
|
require './lib/rubinius/processor/version'
|
4
3
|
|
5
4
|
Gem::Specification.new do |spec|
|
6
5
|
spec.name = "rubinius-processor"
|
7
|
-
spec.version =
|
6
|
+
spec.version = CodeTools::Processor::VERSION
|
8
7
|
spec.authors = ["Brian Shirai"]
|
9
8
|
spec.email = ["brixen@gmail.com"]
|
10
9
|
spec.description = %q{Converts Melbourne parse tree into an AST.}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubinius-processor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.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-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|