ruby_parser 3.6.1 → 3.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.autotest +1 -1
- data/History.txt +7 -1
- data/Rakefile +1 -1
- data/lib/ruby19_parser.rb +2 -0
- data/lib/ruby19_parser.y +2 -0
- data/lib/ruby20_parser.rb +2 -0
- data/lib/ruby20_parser.y +2 -0
- data/lib/ruby21_parser.rb +2 -0
- data/lib/ruby21_parser.y +2 -0
- data/lib/ruby_lexer.rex +0 -2
- data/lib/ruby_lexer.rex.rb +2 -4
- data/lib/ruby_parser_extras.rb +13 -1
- data/test/test_ruby_parser.rb +40 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ac351ad4525bcf28abdb6443e42224edf4421f3
|
4
|
+
data.tar.gz: 8eeb665bfd2c5552211403e22e7ac92fd4d570c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9be0b8f5ac035254f0653d525c4d7b268aa9357b8514f106c76508a3563fbea078f33647178176a5ab40e92df4b97ea1542594245a08532b9d9c2963b73186b0
|
7
|
+
data.tar.gz: 6646425bfed81e551aad7051d779ea01a750657a2f88677618e248f03036f34945ab1a876182fde2731be2c2fdccb15939a9b807fd44007f3b3d18e6394a4353
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.autotest
CHANGED
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/lib/ruby19_parser.rb
CHANGED
data/lib/ruby19_parser.y
CHANGED
data/lib/ruby20_parser.rb
CHANGED
data/lib/ruby20_parser.y
CHANGED
@@ -1494,6 +1494,8 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1494
1494
|
syntax_error "Both block arg and actual block given." if
|
1495
1495
|
val[0].block_pass?
|
1496
1496
|
|
1497
|
+
val = invert_block_call val if inverted? val
|
1498
|
+
|
1497
1499
|
result = val[1]
|
1498
1500
|
result.insert 1, val[0]
|
1499
1501
|
}
|
data/lib/ruby21_parser.rb
CHANGED
data/lib/ruby21_parser.y
CHANGED
@@ -1495,6 +1495,8 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1495
1495
|
syntax_error "Both block arg and actual block given." if
|
1496
1496
|
val[0].block_pass?
|
1497
1497
|
|
1498
|
+
val = invert_block_call val if inverted? val
|
1499
|
+
|
1498
1500
|
result = val[1]
|
1499
1501
|
result.insert 1, val[0]
|
1500
1502
|
}
|
data/lib/ruby_lexer.rex
CHANGED
data/lib/ruby_lexer.rex.rb
CHANGED
@@ -1,13 +1,11 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
#--
|
2
3
|
# This file is automatically generated. Do not modify it.
|
3
|
-
# Generated by: oedipus_lex version 2.
|
4
|
+
# Generated by: oedipus_lex version 2.3.1.
|
4
5
|
# Source: lib/ruby_lexer.rex
|
5
6
|
#++
|
6
7
|
|
7
|
-
# encoding: UTF-8
|
8
|
-
# TODO: this needs to be put on the first line
|
9
8
|
#
|
10
|
-
# new_ruby_parser.rex
|
11
9
|
# lexical scanner definition for ruby
|
12
10
|
|
13
11
|
class RubyLexer
|
data/lib/ruby_parser_extras.rb
CHANGED
@@ -91,7 +91,7 @@ class RPStringScanner < StringScanner
|
|
91
91
|
end
|
92
92
|
|
93
93
|
module RubyParserStuff
|
94
|
-
VERSION = "3.6.
|
94
|
+
VERSION = "3.6.2" unless constants.include? "VERSION" # SIGH
|
95
95
|
|
96
96
|
attr_accessor :lexer, :in_def, :in_single, :file
|
97
97
|
attr_reader :env, :comments
|
@@ -1061,6 +1061,18 @@ module RubyParserStuff
|
|
1061
1061
|
block and call_or_args.block_pass?
|
1062
1062
|
end
|
1063
1063
|
|
1064
|
+
def inverted? val
|
1065
|
+
[:return, :next, :break, :yield].include? val[0].sexp_type
|
1066
|
+
end
|
1067
|
+
|
1068
|
+
def invert_block_call val
|
1069
|
+
(type, call), iter = val
|
1070
|
+
|
1071
|
+
iter.insert 1, call
|
1072
|
+
|
1073
|
+
[iter, s(type)]
|
1074
|
+
end
|
1075
|
+
|
1064
1076
|
def ret_args node
|
1065
1077
|
if node then
|
1066
1078
|
raise "write a test 5" if node[0] == :block_pass
|
data/test/test_ruby_parser.rb
CHANGED
@@ -1643,6 +1643,46 @@ module TestRubyParserShared19to21
|
|
1643
1643
|
assert_parse rb, pt
|
1644
1644
|
end
|
1645
1645
|
|
1646
|
+
def test_block_return
|
1647
|
+
rb = "return foo arg do |bar| end"
|
1648
|
+
pt = s(:return,
|
1649
|
+
s(:iter,
|
1650
|
+
s(:call, nil, :foo, s(:call, nil, :arg)),
|
1651
|
+
s(:args, :bar)))
|
1652
|
+
|
1653
|
+
assert_parse rb, pt
|
1654
|
+
end
|
1655
|
+
|
1656
|
+
def test_block_next
|
1657
|
+
rb = "next foo arg do |bar| end"
|
1658
|
+
pt = s(:next,
|
1659
|
+
s(:iter,
|
1660
|
+
s(:call, nil, :foo, s(:call, nil, :arg)),
|
1661
|
+
s(:args, :bar)))
|
1662
|
+
|
1663
|
+
assert_parse rb, pt
|
1664
|
+
end
|
1665
|
+
|
1666
|
+
def test_block_yield
|
1667
|
+
rb = "yield foo arg do |bar| end"
|
1668
|
+
pt = s(:yield,
|
1669
|
+
s(:iter,
|
1670
|
+
s(:call, nil, :foo, s(:call, nil, :arg)),
|
1671
|
+
s(:args, :bar)))
|
1672
|
+
|
1673
|
+
assert_parse rb, pt
|
1674
|
+
end
|
1675
|
+
|
1676
|
+
def test_block_break
|
1677
|
+
rb = "break foo arg do |bar| end"
|
1678
|
+
pt = s(:break,
|
1679
|
+
s(:iter,
|
1680
|
+
s(:call, nil, :foo, s(:call, nil, :arg)),
|
1681
|
+
s(:args, :bar)))
|
1682
|
+
|
1683
|
+
assert_parse rb, pt
|
1684
|
+
end
|
1685
|
+
|
1646
1686
|
def test_block_splat_reg
|
1647
1687
|
rb = "a { |*b, c| }"
|
1648
1688
|
pt = s(:iter, s(:call, nil, :a), s(:args, :"*b", :c))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
Y4evBVezr3SjXz08vPqRO5YRdO3zfeMT8gBjRqZjWJGMZ2lD4XNfrs7eky74CyZw
|
30
30
|
xx3n58i0lQkBE1EpKE0lFu/y
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2014-
|
32
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: sexp_processor
|
@@ -51,14 +51,14 @@ dependencies:
|
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '5.
|
54
|
+
version: '5.4'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '5.
|
61
|
+
version: '5.4'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rdoc
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|