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: 312 of 184,864
Downloads: 124,581,807

Daily

Ranking: 709 of 184,846
Downloads: 8,678

Depended by

RankDownloadsName
1,02039,255,043gettext_i18n_rails
1,16532,302,791html2haml
1,30227,709,360flay
1,45322,535,860flog
1,65117,236,809ruby2ruby
1,77914,307,201protocol
1,85312,766,901rubycritic
2,2548,002,525fasterer
2,6425,768,834hairtrigger
3,7442,522,358churn
3,8892,299,578roodi
5,2011,124,568debride
5,734878,203safemode
5,900822,372sourcify
5,911817,197dawnscanner
5,923813,506i18nliner
6,957554,625partialruby
7,029541,042wrong
7,551481,216quality
8,080411,376ripper_ruby_parser

Depends on

RankDownloadsName
101,027,861,423rake
75466,255,933racc
202192,079,189rdoc
297132,521,554sexp_processor
2,1598,720,326hoe
21,61165,285oedipus_lex

Owners

#GravatarHandle
1iconzenspider