ruby_parser 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ruby_parser might be problematic. Click here for more details.
- data.tar.gz.sig +2 -2
- data/.gemtest +0 -0
- data/History.txt +10 -0
- data/Manifest.txt +1 -0
- data/Rakefile +3 -24
- data/lib/ruby_lexer.rb +3 -3
- data/lib/ruby_parser.rb +6 -6
- data/lib/ruby_parser_extras.rb +1 -1
- data/test/test_ruby_parser.rb +9 -0
- metadata +23 -22
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
�
|
2
|
-
|
1
|
+
Rn�0z@iD1KG�$A�X6��PL��sX\�}}�|e��le�Q{\F[��n�΅Q�t|��Zݿ7X��Ӕ\U�EV[�dtg�������>�<DG�
|
2
|
+
�c-���_h:xä�(������c!ɪ���c�o�G��q0�Τ�nx�����N7�Fإ���5�M�1�ȯl���T�s�J�����WCHR��y_����h��9T&
|
data/.gemtest
ADDED
File without changes
|
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
@@ -4,41 +4,21 @@ require 'rubygems'
|
|
4
4
|
require 'hoe'
|
5
5
|
|
6
6
|
Hoe.plugin :seattlerb
|
7
|
+
Hoe.plugin :racc
|
7
8
|
|
8
9
|
Hoe.add_include_dirs("../../ParseTree/dev/test",
|
9
10
|
"../../RubyInline/dev/lib",
|
10
11
|
"../../sexp_processor/dev/lib")
|
11
12
|
|
12
|
-
|
13
|
+
Hoe.spec 'ruby_parser' do
|
13
14
|
developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
|
14
15
|
|
15
16
|
self.rubyforge_name = 'parsetree'
|
16
17
|
|
17
18
|
extra_dev_deps << ['ParseTree', '~> 3.0']
|
18
19
|
extra_deps << ['sexp_processor', '~> 3.0']
|
19
|
-
end
|
20
|
-
|
21
|
-
hoe.spec.files += ['lib/ruby_parser.rb'] # jim.... cmon man
|
22
|
-
|
23
|
-
[:default, :multi, :test].each do |t|
|
24
|
-
task t => :parser
|
25
|
-
end
|
26
|
-
|
27
|
-
path = "pkg/ruby_parser-#{hoe.version}"
|
28
|
-
task path => :parser do
|
29
|
-
Dir.chdir path do
|
30
|
-
sh "rake parser"
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
desc "build the parser"
|
35
|
-
task :parser => ["lib/ruby_parser.rb"]
|
36
20
|
|
37
|
-
|
38
|
-
# -v = verbose
|
39
|
-
# -t = debugging parser ~4% reduction in speed -- keep for now
|
40
|
-
# -l = no-line-convert
|
41
|
-
sh "racc -v -t -l -o #{t.name} #{t.source}"
|
21
|
+
self.perforce_ignore << "lib/ruby_parser.rb" if plugin? :perforce
|
42
22
|
end
|
43
23
|
|
44
24
|
task :clean do
|
@@ -46,7 +26,6 @@ task :clean do
|
|
46
26
|
Dir["**/*.diff"] +
|
47
27
|
Dir["coverage.info"] +
|
48
28
|
Dir["coverage"] +
|
49
|
-
Dir["lib/ruby_parser.rb"] +
|
50
29
|
Dir["lib/*.output"])
|
51
30
|
end
|
52
31
|
|
data/lib/ruby_lexer.rb
CHANGED
@@ -231,7 +231,7 @@ class RubyLexer
|
|
231
231
|
end
|
232
232
|
|
233
233
|
def lex_state= o
|
234
|
-
raise "wtf
|
234
|
+
raise "wtf\?" unless Symbol === o
|
235
235
|
@lex_state = o
|
236
236
|
end
|
237
237
|
|
@@ -655,7 +655,7 @@ class RubyLexer
|
|
655
655
|
self.lineno = nil
|
656
656
|
c = src.matched
|
657
657
|
if c == '#' then
|
658
|
-
src.
|
658
|
+
src.pos -= 1
|
659
659
|
|
660
660
|
while src.scan(/\s*#.*(\n+|\z)/) do
|
661
661
|
@comments << src.matched.gsub(/^ +#/, '#').gsub(/^ +$/, '')
|
@@ -723,7 +723,7 @@ class RubyLexer
|
|
723
723
|
self.fix_arg_lex_state
|
724
724
|
tok = self.yacc_value = src.matched
|
725
725
|
return TOKENS[tok]
|
726
|
-
elsif src.
|
726
|
+
elsif src.scan(/\=begin(?=\s)/) then
|
727
727
|
# @comments << '=' << src.matched
|
728
728
|
@comments << src.matched
|
729
729
|
|
data/lib/ruby_parser.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.4.
|
3
|
+
# This file is automatically generated by Racc 1.4.6
|
4
4
|
# from Racc grammer file "".
|
5
5
|
#
|
6
6
|
|
@@ -773,7 +773,7 @@ clist = [
|
|
773
773
|
'299,300,276,279,282,285,288,290,292,294,296,,301,278,,281,284,287,,',
|
774
774
|
',,,,,,,,,,,295,,298,,277,280,283,286,289,291,293,,297,,,,,,,,,,,,,,',
|
775
775
|
',281' ]
|
776
|
-
racc_action_table = arr =
|
776
|
+
racc_action_table = arr = Array.new(23872, nil)
|
777
777
|
idx = 0
|
778
778
|
clist.each do |str|
|
779
779
|
str.split(',', -1).each do |i|
|
@@ -1617,7 +1617,7 @@ clist = [
|
|
1617
1617
|
'747,747,747,747,747,747,747,,747,640,640,640,640,640,640,640,640,640',
|
1618
1618
|
'640,640,,640,640,,747,640,640,,,,,,,,,,,,,,640,,640,,640,640,640,640',
|
1619
1619
|
'640,640,640,,640,,,,,,,,,,,,,,,,640' ]
|
1620
|
-
racc_action_check = arr =
|
1620
|
+
racc_action_check = arr = Array.new(23872, nil)
|
1621
1621
|
idx = 0
|
1622
1622
|
clist.each do |str|
|
1623
1623
|
str.split(',', -1).each do |i|
|
@@ -1881,7 +1881,7 @@ clist = [
|
|
1881
1881
|
',,,,,,,,,,,,,,,,,,820,,,,823,,,,,,,,,,,38,,849,,832,,,835,,,,,38,,,',
|
1882
1882
|
',38,,,,,,,,,,,38,,,38,,,,,,,,,,,,38,661,38,,,,,,,584,,,589,,,,,,,,,',
|
1883
1883
|
',,,,,,,,,,,,,,880,,,,,882,,,885,,,,,,,,,,,,,,,,,,589,,,,,,,,,,,,,,900' ]
|
1884
|
-
racc_goto_table = arr =
|
1884
|
+
racc_goto_table = arr = Array.new(2455, nil)
|
1885
1885
|
idx = 0
|
1886
1886
|
clist.each do |str|
|
1887
1887
|
str.split(',', -1).each do |i|
|
@@ -1952,7 +1952,7 @@ clist = [
|
|
1952
1952
|
'45,,,,,45,,,,,,,,,,,,,,,,,,,24,,,,24,,,,,,,,,,,45,,45,,24,,,24,,,,,45',
|
1953
1953
|
',,,,45,,,,,,,,,,,45,,,45,,,,,,,,,,,,45,24,45,,,,,,,24,,,24,,,,,,,,,',
|
1954
1954
|
',,,,,,,,,,,,,,24,,,,,24,,,24,,,,,,,,,,,,,,,,,,24,,,,,,,,,,,,,,24' ]
|
1955
|
-
racc_goto_check = arr =
|
1955
|
+
racc_goto_check = arr = Array.new(2455, nil)
|
1956
1956
|
idx = 0
|
1957
1957
|
clist.each do |str|
|
1958
1958
|
str.split(',', -1).each do |i|
|
@@ -2941,7 +2941,7 @@ Racc_token_to_s_table = [
|
|
2941
2941
|
"@39",
|
2942
2942
|
"assoc" ]
|
2943
2943
|
|
2944
|
-
Racc_debug_parser =
|
2944
|
+
Racc_debug_parser = false
|
2945
2945
|
|
2946
2946
|
##### State transition tables end #####
|
2947
2947
|
|
data/lib/ruby_parser_extras.rb
CHANGED
@@ -115,7 +115,7 @@ class RPStringScanner < StringScanner
|
|
115
115
|
end
|
116
116
|
|
117
117
|
class RubyParser < Racc::Parser
|
118
|
-
VERSION = '2.0.
|
118
|
+
VERSION = '2.0.6' unless constants.include? "VERSION" # SIGH
|
119
119
|
|
120
120
|
attr_accessor :lexer, :in_def, :in_single, :file
|
121
121
|
attr_reader :env, :comments
|
data/test/test_ruby_parser.rb
CHANGED
@@ -175,6 +175,15 @@ class TestRubyParser < RubyParserTestCase
|
|
175
175
|
assert_equal pt, @processor.parse(rb)
|
176
176
|
end
|
177
177
|
|
178
|
+
def test_bug_comment_eq_begin
|
179
|
+
rb = "\n\n#\n=begin\nblah\n=end\n\n"
|
180
|
+
pt = nil
|
181
|
+
exp = rb[2..-1]
|
182
|
+
|
183
|
+
assert_equal pt, @processor.parse(rb)
|
184
|
+
assert_equal exp, @processor.lexer.comments
|
185
|
+
end
|
186
|
+
|
178
187
|
def test_dstr_evstr
|
179
188
|
rb = "\"#\{'a'}#\{b}\""
|
180
189
|
pt = s(:dstr, "a", s(:evstr, s(:call, nil, :b, s(:arglist))))
|
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:
|
5
|
-
prerelease:
|
4
|
+
hash: 3
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 6
|
10
|
+
version: 2.0.6
|
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:
|
39
|
+
date: 2011-02-18 00:00:00 -08:00
|
40
40
|
default_executable:
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
@@ -55,19 +55,19 @@ dependencies:
|
|
55
55
|
type: :runtime
|
56
56
|
version_requirements: *id001
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
|
-
name:
|
58
|
+
name: racc
|
59
59
|
prerelease: false
|
60
60
|
requirement: &id002 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
|
-
- -
|
63
|
+
- - ~>
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
hash:
|
65
|
+
hash: 9
|
66
66
|
segments:
|
67
|
-
-
|
68
|
-
- 0
|
67
|
+
- 1
|
69
68
|
- 4
|
70
|
-
|
69
|
+
- 7
|
70
|
+
version: 1.4.7
|
71
71
|
type: :development
|
72
72
|
version_requirements: *id002
|
73
73
|
- !ruby/object:Gem::Dependency
|
@@ -78,12 +78,12 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
hash:
|
81
|
+
hash: 11
|
82
82
|
segments:
|
83
|
-
-
|
84
|
-
-
|
85
|
-
-
|
86
|
-
version:
|
83
|
+
- 2
|
84
|
+
- 0
|
85
|
+
- 2
|
86
|
+
version: 2.0.2
|
87
87
|
type: :development
|
88
88
|
version_requirements: *id003
|
89
89
|
- !ruby/object:Gem::Dependency
|
@@ -109,12 +109,12 @@ dependencies:
|
|
109
109
|
requirements:
|
110
110
|
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
hash:
|
112
|
+
hash: 41
|
113
113
|
segments:
|
114
114
|
- 2
|
115
|
-
-
|
116
|
-
-
|
117
|
-
version: 2.
|
115
|
+
- 9
|
116
|
+
- 1
|
117
|
+
version: 2.9.1
|
118
118
|
type: :development
|
119
119
|
version_requirements: *id005
|
120
120
|
description: |-
|
@@ -163,11 +163,12 @@ files:
|
|
163
163
|
- lib/gauntlet_rubyparser.rb
|
164
164
|
- lib/ruby_lexer.rb
|
165
165
|
- lib/ruby_parser.y
|
166
|
+
- lib/ruby_parser.rb
|
166
167
|
- lib/ruby_parser_extras.rb
|
167
168
|
- test/test_ruby_lexer.rb
|
168
169
|
- test/test_ruby_parser.rb
|
169
170
|
- test/test_ruby_parser_extras.rb
|
170
|
-
-
|
171
|
+
- .gemtest
|
171
172
|
has_rdoc: true
|
172
173
|
homepage: http://parsetree.rubyforge.org/
|
173
174
|
licenses: []
|
@@ -199,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
200
|
requirements: []
|
200
201
|
|
201
202
|
rubyforge_project: parsetree
|
202
|
-
rubygems_version: 1.
|
203
|
+
rubygems_version: 1.4.2
|
203
204
|
signing_key:
|
204
205
|
specification_version: 3
|
205
206
|
summary: ruby_parser (RP) is a ruby parser written in pure ruby (utilizing racc--which does by default use a C extension)
|
metadata.gz.sig
CHANGED
Binary file
|