ruby_parser 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ruby_parser might be problematic. Click here for more details.
- data/History.txt +7 -0
- data/lib/ruby_parser_extras.rb +16 -5
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
data/History.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
=== 3.0.1 / 2012-11-02
|
2
|
+
|
3
|
+
* 2 bug fixes -- both based on MRI bugs... Yay?:
|
4
|
+
|
5
|
+
* 1.9.2 doesn't have String#byteslice... so I have to do the *HORRIBLE*.
|
6
|
+
* Lexing regexps w/ bad character encodings and no declared options will fall back to /.../n.
|
7
|
+
|
1
8
|
=== 3.0.0 / 2012-11-02
|
2
9
|
|
3
10
|
I've hit 99.967% success rate against 558k files! 3.6σ!! 182 files
|
data/lib/ruby_parser_extras.rb
CHANGED
@@ -36,8 +36,14 @@ class RPStringScanner < StringScanner
|
|
36
36
|
# end
|
37
37
|
|
38
38
|
if "".respond_to? :encoding then
|
39
|
-
|
40
|
-
|
39
|
+
if "".respond_to? :byteslice then
|
40
|
+
def string_to_pos
|
41
|
+
string.byteslice(0, pos)
|
42
|
+
end
|
43
|
+
else
|
44
|
+
def string_to_pos
|
45
|
+
string.bytes.first(pos).pack("c*").force_encoding(string.encoding)
|
46
|
+
end
|
41
47
|
end
|
42
48
|
|
43
49
|
def charpos
|
@@ -102,7 +108,7 @@ class RPStringScanner < StringScanner
|
|
102
108
|
end
|
103
109
|
|
104
110
|
module RubyParserStuff
|
105
|
-
VERSION = '3.0.
|
111
|
+
VERSION = '3.0.1' unless constants.include? "VERSION" # SIGH
|
106
112
|
|
107
113
|
attr_accessor :lexer, :in_def, :in_single, :file
|
108
114
|
attr_reader :env, :comments
|
@@ -713,8 +719,13 @@ module RubyParserStuff
|
|
713
719
|
node[1] = if k then
|
714
720
|
Regexp.new(node[1], o, k)
|
715
721
|
else
|
716
|
-
|
717
|
-
|
722
|
+
begin
|
723
|
+
Regexp.new(node[1], o)
|
724
|
+
rescue RegexpError => e
|
725
|
+
warn "Ignoring: #{e.message}"
|
726
|
+
Regexp.new(node[1], Regexp::ENC_NONE)
|
727
|
+
end
|
728
|
+
end
|
718
729
|
when :dstr then
|
719
730
|
if options =~ /o/ then
|
720
731
|
node[0] = :dregx_once
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- 1
|
10
|
+
version: 3.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Davis
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
FBHgymkyj/AOSqKRIpXPhjC6
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2012-11-
|
39
|
+
date: 2012-11-03 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sexp_processor
|
metadata.gz.sig
CHANGED
Binary file
|