Categories: None [Edit]

ruby_parser

https://rubygems.org/gems/ruby_parser
https://github.com/seattlerb/ruby_parser
ruby_parser (RP) is a ruby parser written in pure ruby (utilizing racc--which does by default use a C extension). It outputs s-expressions which can be manipulated and converted back to ruby via the ruby2ruby gem. As an example: def conditional1 arg1 return 1 if arg1 == 0 return 0 end becomes: s(:defn, :conditional1, s(:args, :arg1), s(:if, s(:call, s(:lvar, :arg1), :==, s(:lit, 0)), s(:return, s(:lit, 1)), nil), s(:return, s(:lit, 0))) Tested against 801,039 files from the latest of all rubygems (as of 2013-05): * 1.8 parser is at 99.9739% accuracy, 3.651 sigma * 1.9 parser is at 99.9940% accuracy, 4.013 sigma * 2.0 parser is at 99.9939% accuracy, 4.008 sigma * 2.6 parser is at 99.9972% accuracy, 4.191 sigma * 3.0 parser has a 100% parse rate. * Tested against 2,672,412 unique ruby files across 167k gems. * As do all the others now, basically.

Total

Ranking: 307 of 184,163
Downloads: 123,016,012

Daily

Ranking: 933 of 184,148
Downloads: 40,967

Depended by

RankDownloadsName
1,02237,408,023gettext_i18n_rails
1,13432,026,489html2haml
1,28727,218,200flay
1,43422,090,678flog
1,63016,965,523ruby2ruby
1,76714,162,763protocol
1,84012,434,900rubycritic
2,2537,788,093fasterer
2,6385,575,299hairtrigger
3,7112,498,590churn
3,8532,284,837roodi
5,2141,083,382debride
5,672874,976safemode
5,846813,979sourcify
5,863806,368dawnscanner
5,867805,305i18nliner
6,878551,633partialruby
6,955535,456wrong
7,310478,661quality
7,983410,365ripper_ruby_parser

Depends on

RankDownloadsName
10997,150,927rake
78438,470,673racc
206181,655,885rdoc
292130,894,478sexp_processor
2,1338,665,997hoe
21,74363,811oedipus_lex

Owners

#GravatarHandle
1iconzenspider