ruby_parser 2.0.2 → 2.0.3

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 ADDED
@@ -0,0 +1,2 @@
1
+ �FW�s"a�zM���h���/'��y������" ���u��[6֮��
2
+ ��oE�y±#Q�+Tm���f��}́�,m��|��l���r�1��Wo�S�R%F�b�yD��x#8xÄC��x��w��ɛ�L�ڀ��9��g��J����q�Dm�������>D��_� ��
data/.autotest CHANGED
@@ -1,14 +1,15 @@
1
1
  # -*- ruby -*-
2
2
 
3
3
  require 'autotest/restart'
4
+ require 'autotest/rcov'
4
5
 
5
6
  Autotest.add_hook :initialize do |at|
6
7
  at.extra_files << "../../ParseTree/dev/test/pt_testcase.rb"
7
8
  at.libs << ":../../ParseTree/dev/lib:../../ParseTree/dev/test:../../sexp_processor/dev/lib"
8
9
  at.add_exception 'unit'
9
10
  at.add_exception 'coverage'
10
- at.add_exception '.diff'
11
11
  at.add_exception 'coverage.info'
12
+ at.add_exception '.diff'
12
13
 
13
14
  at.unit_diff = "unit_diff -u -b"
14
15
 
@@ -38,7 +39,3 @@ class Autotest
38
39
  File.expand_path "~/.multiruby/install/1.9.0-0/bin/ruby"
39
40
  end
40
41
  end if ENV['ONENINE']
41
-
42
- # require 'autotest/rcov'
43
- # Autotest::RCov.command = 'rcov_info'
44
- # Autotest::RCov.pattern = 'test/test_ruby_lexer.rb'
data/History.txt CHANGED
@@ -1,3 +1,19 @@
1
+ === 2.0.3 / 2009-06-23
2
+
3
+ * 4 minor enhancements:
4
+
5
+ * Removed dead code handling d/regex match node cruft.
6
+ * Switched to minitest
7
+ * Updated .autotest and rakefile wrt rcov for new hoe capabilities
8
+ * Updated hoe for new capabilities
9
+
10
+ * 4 bug fixes:
11
+
12
+ * Environment#all now deals with strange edge cases in RAD.
13
+ * Fixed packaging/compilation issue.
14
+ * Minor 1.9 fixes
15
+ * hoe -> flay -> rubyparser rakefile circularity fixed
16
+
1
17
  === 2.0.2 / 2009-01-20
2
18
 
3
19
  * 2 minor enhancements:
data/Rakefile CHANGED
@@ -3,19 +3,19 @@
3
3
  require 'rubygems'
4
4
  require 'hoe'
5
5
 
6
- Hoe.add_include_dirs("../../ParseTree/dev/lib",
7
- "../../ParseTree/dev/test",
6
+ Hoe.plugin :seattlerb
7
+
8
+ Hoe.add_include_dirs("../../ParseTree/dev/test",
8
9
  "../../RubyInline/dev/lib",
9
10
  "../../sexp_processor/dev/lib")
10
11
 
11
- require './lib/ruby_parser_extras.rb'
12
+ hoe = Hoe.spec 'ruby_parser' do
13
+ developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
12
14
 
13
- hoe = Hoe.new('ruby_parser', RubyParser::VERSION) do |parser|
14
- parser.rubyforge_name = 'parsetree'
15
- parser.developer('Ryan Davis', 'ryand-ruby@zenspider.com')
15
+ self.rubyforge_name = 'parsetree'
16
16
 
17
- parser.extra_dev_deps << 'ParseTree'
18
- parser.extra_deps << ['sexp_processor', '>= 3.0.1']
17
+ extra_dev_deps << 'ParseTree'
18
+ extra_deps << ['sexp_processor', '>= 3.0.1']
19
19
  end
20
20
 
21
21
  hoe.spec.files += ['lib/ruby_parser.rb'] # jim.... cmon man
@@ -24,7 +24,7 @@ hoe.spec.files += ['lib/ruby_parser.rb'] # jim.... cmon man
24
24
  task t => :parser
25
25
  end
26
26
 
27
- path = "pkg/ruby_parser-#{RubyParser::VERSION}"
27
+ path = "pkg/ruby_parser-#{hoe.version}"
28
28
  task path => :parser do
29
29
  Dir.chdir path do
30
30
  sh "rake parser"
@@ -54,20 +54,6 @@ def next_num(glob)
54
54
  num = Dir[glob].max[/\d+/].to_i + 1
55
55
  end
56
56
 
57
- begin
58
- require 'rcov/rcovtask'
59
- Rcov::RcovTask.new do |t|
60
- pattern = ENV['PATTERN'] || 'test/test_ruby_*.rb'
61
-
62
- t.test_files = FileList[pattern]
63
- t.verbose = true
64
- t.rcov_opts << "--threshold 80"
65
- t.rcov_opts << "--no-color"
66
- end
67
- rescue LoadError
68
- # skip
69
- end
70
-
71
57
  desc "Compares PT to RP and deletes all files that match"
72
58
  task :compare do
73
59
  files = Dir["unit/**/*.rb"]
@@ -94,19 +80,6 @@ task :sort do
94
80
  sh 'grepsort "^ +def (test|util)" test/test_ruby_lexer.rb'
95
81
  end
96
82
 
97
- task :rcov_info => :parser do
98
- pattern = ENV['PATTERN'] || "test/test_*.rb"
99
- ruby "-Ilib -S rcov --text-report --save coverage.info #{pattern}"
100
- end
101
-
102
- task :rcov_overlay do
103
- rcov, eol = Marshal.load(File.read("coverage.info")).last[ENV["FILE"]], 1
104
- puts rcov[:lines].zip(rcov[:coverage]).map { |line, coverage|
105
- bol, eol = eol, eol + line.length
106
- [bol, eol, "#ffcccc"] unless coverage
107
- }.compact.inspect
108
- end
109
-
110
83
  task :loc do
111
84
  loc1 = `wc -l ../1.0.0/lib/ruby_lexer.rb`[/\d+/]
112
85
  flog1 = `flog -s ../1.0.0/lib/ruby_lexer.rb`[/\d+\.\d+/]
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.6
3
+ # This file is automatically generated by Racc 1.4.7
4
4
  # from Racc grammer file "".
5
5
  #
6
6
 
@@ -772,7 +772,7 @@ clist = [
772
772
  '299,300,276,279,282,285,288,290,292,294,296,,301,278,,281,284,287,,',
773
773
  ',,,,,,,,,,,295,,298,,277,280,283,286,289,291,293,,297,,,,,,,,,,,,,,',
774
774
  ',281' ]
775
- racc_action_table = arr = Array.new(23872, nil)
775
+ racc_action_table = arr = ::Array.new(23872, nil)
776
776
  idx = 0
777
777
  clist.each do |str|
778
778
  str.split(',', -1).each do |i|
@@ -1616,7 +1616,7 @@ clist = [
1616
1616
  '747,747,747,747,747,747,747,,747,640,640,640,640,640,640,640,640,640',
1617
1617
  '640,640,,640,640,,747,640,640,,,,,,,,,,,,,,640,,640,,640,640,640,640',
1618
1618
  '640,640,640,,640,,,,,,,,,,,,,,,,640' ]
1619
- racc_action_check = arr = Array.new(23872, nil)
1619
+ racc_action_check = arr = ::Array.new(23872, nil)
1620
1620
  idx = 0
1621
1621
  clist.each do |str|
1622
1622
  str.split(',', -1).each do |i|
@@ -1880,7 +1880,7 @@ clist = [
1880
1880
  ',,,,,,,,,,,,,,,,,,820,,,,823,,,,,,,,,,,38,,849,,832,,,835,,,,,38,,,',
1881
1881
  ',38,,,,,,,,,,,38,,,38,,,,,,,,,,,,38,661,38,,,,,,,584,,,589,,,,,,,,,',
1882
1882
  ',,,,,,,,,,,,,,880,,,,,882,,,885,,,,,,,,,,,,,,,,,,589,,,,,,,,,,,,,,900' ]
1883
- racc_goto_table = arr = Array.new(2455, nil)
1883
+ racc_goto_table = arr = ::Array.new(2455, nil)
1884
1884
  idx = 0
1885
1885
  clist.each do |str|
1886
1886
  str.split(',', -1).each do |i|
@@ -1951,7 +1951,7 @@ clist = [
1951
1951
  '45,,,,,45,,,,,,,,,,,,,,,,,,,24,,,,24,,,,,,,,,,,45,,45,,24,,,24,,,,,45',
1952
1952
  ',,,,45,,,,,,,,,,,45,,,45,,,,,,,,,,,,45,24,45,,,,,,,24,,,24,,,,,,,,,',
1953
1953
  ',,,,,,,,,,,,,,24,,,,,24,,,24,,,,,,,,,,,,,,,,,,24,,,,,,,,,,,,,,24' ]
1954
- racc_goto_check = arr = Array.new(2455, nil)
1954
+ racc_goto_check = arr = ::Array.new(2455, nil)
1955
1955
  idx = 0
1956
1956
  clist.each do |str|
1957
1957
  str.split(',', -1).each do |i|
@@ -5,11 +5,13 @@ require 'strscan'
5
5
 
6
6
  # WHY do I have to do this?!?
7
7
  class Regexp
8
- ONCE = 0 # 16 # ?
9
- ENC_NONE = /x/n.options
10
- ENC_EUC = /x/e.options
11
- ENC_SJIS = /x/s.options
12
- ENC_UTF8 = /x/u.options
8
+ unless defined? ONCE then
9
+ ONCE = 0 # 16 # ?
10
+ ENC_NONE = /x/n.options
11
+ ENC_EUC = /x/e.options
12
+ ENC_SJIS = /x/s.options
13
+ ENC_UTF8 = /x/u.options
14
+ end
13
15
  end
14
16
 
15
17
  # I hate ruby 1.9 string changes
@@ -113,7 +115,7 @@ class RPStringScanner < StringScanner
113
115
  end
114
116
 
115
117
  class RubyParser < Racc::Parser
116
- VERSION = '2.0.2'
118
+ VERSION = '2.0.3' unless constants.include? "VERSION" # SIGH
117
119
 
118
120
  attr_accessor :lexer, :in_def, :in_single, :file
119
121
  attr_reader :env, :comments
@@ -244,10 +246,6 @@ class RubyParser < Racc::Parser
244
246
  node = value_expr node
245
247
 
246
248
  case node.first
247
- when :dregex then
248
- return s(:match2, node, s(:gvar, "$_".to_sym))
249
- when :regex then
250
- return s(:match, node)
251
249
  when :lit then
252
250
  if Regexp === node.last then
253
251
  return s(:match, node)
@@ -885,7 +883,8 @@ class Keyword
885
883
 
886
884
  # :startdoc:
887
885
 
888
- WORDLIST = Hash[*wordlist.map { |o| [o.name, o] }.flatten]
886
+ WORDLIST = Hash[*wordlist.map { |o| [o.name, o] }.flatten] unless
887
+ defined? WORDLIST
889
888
 
890
889
  def self.keyword str
891
890
  WORDLIST[str]
@@ -905,7 +904,7 @@ class Environment
905
904
  end
906
905
 
907
906
  def all
908
- idx = @dyn.index false
907
+ idx = @dyn.index(false) || 0
909
908
  @env[0..idx].reverse.inject { |env, scope| env.merge scope }
910
909
  end
911
910
 
@@ -926,7 +925,7 @@ class Environment
926
925
  @dyn.unshift dyn
927
926
  @env.unshift({})
928
927
  @use.unshift({})
929
- end
928
+ end
930
929
 
931
930
  def initialize dyn = false
932
931
  @dyn = []
@@ -1,12 +1,10 @@
1
1
  #!/usr/local/bin/ruby
2
2
 
3
- require "test/unit"
3
+ require "minitest/autorun"
4
4
  require "ruby_lexer"
5
5
 
6
- class TestRubyLexer < Test::Unit::TestCase
7
- def deny cond, msg = nil
8
- assert ! cond, msg
9
- end
6
+ class TestRubyLexer < MiniTest::Unit::TestCase
7
+ alias :deny :refute
10
8
 
11
9
  def setup
12
10
  p = RubyParser.new
@@ -1,9 +1,8 @@
1
1
  #!/usr/local/bin/ruby
2
2
 
3
- require 'test/unit'
3
+ require 'minitest/autorun'
4
4
  require 'ruby_parser'
5
5
 
6
- $: << File.expand_path('~/Work/p4/zss/src/ParseTree/dev/lib')
7
6
  $: << File.expand_path('~/Work/p4/zss/src/ParseTree/dev/test')
8
7
 
9
8
  require 'pt_testcase'
@@ -30,8 +29,6 @@ class RubyParserTestCase < ParseTreeTestCase
30
29
  end
31
30
 
32
31
  class TestRubyParser < RubyParserTestCase
33
- alias :refute_nil :assert_not_nil unless defined? Mini
34
-
35
32
  def setup
36
33
  super
37
34
 
@@ -1,7 +1,7 @@
1
- require 'test/unit'
1
+ require 'minitest/autorun'
2
2
  require 'ruby_parser_extras'
3
3
 
4
- class TestStackState < Test::Unit::TestCase
4
+ class TestStackState < MiniTest::Unit::TestCase
5
5
  def test_stack_state
6
6
  s = StackState.new :test
7
7
  s.push true
@@ -49,7 +49,7 @@ class TestStackState < Test::Unit::TestCase
49
49
  end
50
50
  end
51
51
 
52
- class TestEnvironment < Test::Unit::TestCase
52
+ class TestEnvironment < MiniTest::Unit::TestCase
53
53
  def deny t
54
54
  assert ! t
55
55
  end
metadata CHANGED
@@ -1,15 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain: []
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
14
+ ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
+ GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
16
+ AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
17
+ JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
18
+ b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
19
+ taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
20
+ oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
21
+ GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
22
+ qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
23
+ gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
24
+ HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
25
+ AQAY59gYvDxqSqgC92nAP9P8dnGgfZgLxP237xS6XxFGJSghdz/nI6pusfCWKM8m
26
+ vzjjH2wUMSSf3tNudQ3rCGLf2epkcU13/rguI88wO6MrE0wi4ZqLQX+eZQFskJb/
27
+ w6x9W1ur8eR01s397LSMexySDBrJOh34cm2AlfKr/jokKCTwcM0OvVZnAutaovC0
28
+ l1SVZ0ecg88bsWHA0Yhh7NFxK1utWoIhtB6AFC/+trM0FQEB/jZkIS8SaNzn96Rl
29
+ n0sZEf77FLf5peR8TP/PtmIg7Cyqz23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
30
+ FBHgymkyj/AOSqKRIpXPhjC6
31
+ -----END CERTIFICATE-----
11
32
 
12
- date: 2009-01-20 00:00:00 -08:00
33
+ date: 2009-06-23 00:00:00 -07:00
13
34
  default_executable:
14
35
  dependencies:
15
36
  - !ruby/object:Gem::Dependency
@@ -40,9 +61,34 @@ dependencies:
40
61
  requirements:
41
62
  - - ">="
42
63
  - !ruby/object:Gem::Version
43
- version: 1.8.2
64
+ version: 2.3.0
44
65
  version:
45
- description: "ruby_parser (RP) is a ruby parser written in pure ruby (utilizing racc--which does by default use a C extension). RP's output is the same as ParseTree's output: s-expressions using ruby's arrays and base types. As an example: def conditional1(arg1) if arg1 == 0 then return 1 end return 0 end becomes: s(:defn, :conditional1, s(:args, :arg1), s(:scope, s(:block, s(:if, s(:call, s(:lvar, :arg1), :==, s(:arglist, s(:lit, 0))), s(:return, s(:lit, 1)), nil), s(:return, s(:lit, 0)))))"
66
+ description: |-
67
+ ruby_parser (RP) is a ruby parser written in pure ruby (utilizing
68
+ racc--which does by default use a C extension). RP's output is
69
+ the same as ParseTree's output: s-expressions using ruby's arrays and
70
+ base types.
71
+
72
+ As an example:
73
+
74
+ def conditional1(arg1)
75
+ if arg1 == 0 then
76
+ return 1
77
+ end
78
+ return 0
79
+ end
80
+
81
+ becomes:
82
+
83
+ s(:defn, :conditional1,
84
+ s(:args, :arg1),
85
+ s(:scope,
86
+ s(:block,
87
+ s(:if,
88
+ s(:call, s(:lvar, :arg1), :==, s(:arglist, s(:lit, 0))),
89
+ s(:return, s(:lit, 1)),
90
+ nil),
91
+ s(:return, s(:lit, 0)))))
46
92
  email:
47
93
  - ryand-ruby@zenspider.com
48
94
  executables:
@@ -70,6 +116,8 @@ files:
70
116
  - lib/ruby_parser.rb
71
117
  has_rdoc: true
72
118
  homepage: http://parsetree.rubyforge.org/
119
+ licenses: []
120
+
73
121
  post_install_message:
74
122
  rdoc_options:
75
123
  - --main
@@ -91,9 +139,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
139
  requirements: []
92
140
 
93
141
  rubyforge_project: parsetree
94
- rubygems_version: 1.3.1
142
+ rubygems_version: 1.3.4
95
143
  signing_key:
96
- specification_version: 2
144
+ specification_version: 3
97
145
  summary: ruby_parser (RP) is a ruby parser written in pure ruby (utilizing racc--which does by default use a C extension)
98
146
  test_files:
99
147
  - test/test_ruby_lexer.rb
metadata.gz.sig ADDED
Binary file