rubinius-processor 2.1.1 → 2.1.2
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 +2 -142
- data/lib/rubinius/processor/version.rb +1 -1
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79320dfe785686c2fdccb6a9fb476ad0468dd2b4
|
4
|
+
data.tar.gz: d580a2826c288c58a0243db88155cc87a09268b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28c07444dd8a4919ba0031a2d1a176eeb2485292f34ccbfc2ed13e41564d2ff5ac159f277d05e2c67c83585097c699e5861e4ec5dd2683ec57cd5272aac18558
|
7
|
+
data.tar.gz: 319cf6f212fd20836ca5c15c4960d68437f6d3c05320cb38c8d18730b397662211b3025726f4ce5472aca3bafeae9bee03bb278cee9bee4bf2339db65b1ad99f
|
@@ -335,13 +335,14 @@ module Rubinius::ToolSets.current::ToolSet
|
|
335
335
|
body = scope
|
336
336
|
end
|
337
337
|
|
338
|
-
receiver = AST::
|
338
|
+
receiver = AST::ToplevelConstant.new line, :Kernel
|
339
339
|
method_send = AST::Send.new line, receiver, :lambda, true
|
340
340
|
|
341
341
|
method_send.block = AST::Iter19.new line, arguments, body
|
342
342
|
method_send
|
343
343
|
end
|
344
344
|
|
345
|
+
|
345
346
|
def process_lasgn(line, name, value)
|
346
347
|
AST::LocalVariableAssignment.new line, name, value
|
347
348
|
end
|
@@ -590,145 +591,4 @@ module Rubinius::ToolSets.current::ToolSet
|
|
590
591
|
AST::ZSuper.new line
|
591
592
|
end
|
592
593
|
end
|
593
|
-
|
594
|
-
class Melbourne19 < Melbourne
|
595
|
-
def process_args(line, required, optional, splat, post, block)
|
596
|
-
AST::FormalArguments19.new line, required, optional, splat, post, block
|
597
|
-
end
|
598
|
-
|
599
|
-
def process_block_pass(line, arguments, body)
|
600
|
-
AST::BlockPass19.new line, arguments, body
|
601
|
-
end
|
602
|
-
|
603
|
-
def process_encoding(line, name)
|
604
|
-
AST::Encoding.new line, name
|
605
|
-
end
|
606
|
-
|
607
|
-
def process_postarg(line, into, rest)
|
608
|
-
AST::PostArg.new line, into, rest
|
609
|
-
end
|
610
|
-
|
611
|
-
def process_iter(line, method_send, scope)
|
612
|
-
ary = scope && scope.array || []
|
613
|
-
arguments = nil
|
614
|
-
|
615
|
-
if ary.first.kind_of? AST::FormalArguments
|
616
|
-
arguments = scope.array.shift
|
617
|
-
end
|
618
|
-
|
619
|
-
unless arguments
|
620
|
-
arguments = AST::FormalArguments19.new line, nil, nil, nil, nil, nil
|
621
|
-
end
|
622
|
-
|
623
|
-
case ary.size
|
624
|
-
when 0
|
625
|
-
body = nil
|
626
|
-
when 1
|
627
|
-
if scope.locals
|
628
|
-
body = scope
|
629
|
-
else
|
630
|
-
body = scope.array.shift
|
631
|
-
end
|
632
|
-
else
|
633
|
-
body = scope
|
634
|
-
end
|
635
|
-
|
636
|
-
method_send.block = AST::Iter19.new line, arguments, body
|
637
|
-
method_send
|
638
|
-
end
|
639
|
-
|
640
|
-
def process_for(line, iter, arguments, body)
|
641
|
-
send = AST::Send.new line, iter, :each
|
642
|
-
send.block = AST::For19.new line, arguments, body
|
643
|
-
send
|
644
|
-
end
|
645
|
-
|
646
|
-
def process_lambda(line, scope)
|
647
|
-
arguments = scope.array.shift
|
648
|
-
if scope.array.size == 1
|
649
|
-
body = scope.array.shift
|
650
|
-
else
|
651
|
-
body = scope
|
652
|
-
end
|
653
|
-
|
654
|
-
receiver = AST::Self.new line
|
655
|
-
method_send = AST::Send.new line, receiver, :lambda, true
|
656
|
-
|
657
|
-
method_send.block = AST::Iter19.new line, arguments, body
|
658
|
-
method_send
|
659
|
-
end
|
660
|
-
|
661
|
-
def process_number(line, value)
|
662
|
-
case value
|
663
|
-
when Fixnum
|
664
|
-
AST::FixnumLiteral.new line, value
|
665
|
-
when Bignum
|
666
|
-
AST::NumberLiteral.new line, value
|
667
|
-
end
|
668
|
-
end
|
669
|
-
|
670
|
-
def process_op_asgn_or(line, var, value)
|
671
|
-
AST::OpAssignOr19.new line, var, value
|
672
|
-
end
|
673
|
-
|
674
|
-
def process_opt_arg(line, arguments)
|
675
|
-
AST::Block.new line, arguments
|
676
|
-
end
|
677
|
-
|
678
|
-
def process_postexe(line, body)
|
679
|
-
node = AST::Send.new line, AST::Self.new(line), :at_exit, true
|
680
|
-
node.block = AST::Iter.new line, nil, body
|
681
|
-
node
|
682
|
-
end
|
683
|
-
|
684
|
-
def process_preexe(line, body)
|
685
|
-
node = AST::PreExe19.new line
|
686
|
-
node.block = AST::Iter19.new line, nil, body
|
687
|
-
add_pre_exe node
|
688
|
-
node
|
689
|
-
end
|
690
|
-
|
691
|
-
def process_scope(line, arguments, body, locals)
|
692
|
-
case body
|
693
|
-
when AST::Begin
|
694
|
-
if body.rescue.kind_of? AST::NilLiteral
|
695
|
-
return nil unless arguments
|
696
|
-
end
|
697
|
-
body = AST::Block.new line, [body.rescue]
|
698
|
-
when AST::Block
|
699
|
-
ary = body.array
|
700
|
-
if ary.size > 1 and
|
701
|
-
ary.first.kind_of?(AST::Begin) and
|
702
|
-
ary.first.rescue.kind_of?(AST::NilLiteral)
|
703
|
-
ary.shift
|
704
|
-
end
|
705
|
-
when nil
|
706
|
-
# Nothing
|
707
|
-
else
|
708
|
-
body = AST::Block.new line, [body]
|
709
|
-
end
|
710
|
-
|
711
|
-
if arguments and body
|
712
|
-
body.array.unshift arguments
|
713
|
-
end
|
714
|
-
|
715
|
-
body.locals = locals if locals
|
716
|
-
|
717
|
-
body
|
718
|
-
end
|
719
|
-
|
720
|
-
def process_super(line, arguments)
|
721
|
-
if arguments.kind_of? AST::BlockPass
|
722
|
-
block = arguments
|
723
|
-
arguments = block.arguments
|
724
|
-
block.arguments = nil
|
725
|
-
else
|
726
|
-
block = nil
|
727
|
-
end
|
728
|
-
|
729
|
-
node = AST::Super.new line, arguments
|
730
|
-
node.block = block
|
731
|
-
node
|
732
|
-
end
|
733
|
-
end
|
734
594
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubinius-processor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
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-05-09 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
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
23
|
requirements:
|
22
24
|
- - "~>"
|
23
25
|
- !ruby/object:Gem::Version
|
24
26
|
version: '1.3'
|
25
|
-
prerelease: false
|
26
|
-
type: :development
|
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
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
35
37
|
requirements:
|
36
38
|
- - "~>"
|
37
39
|
- !ruby/object:Gem::Version
|
38
40
|
version: '10.0'
|
39
|
-
prerelease: false
|
40
|
-
type: :development
|
41
41
|
description: Converts Melbourne parse tree into an AST.
|
42
42
|
email:
|
43
43
|
- brixen@gmail.com
|
@@ -79,4 +79,3 @@ signing_key:
|
|
79
79
|
specification_version: 4
|
80
80
|
summary: Converts Melbourne parse tree into an AST.
|
81
81
|
test_files: []
|
82
|
-
has_rdoc:
|