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: 329 of 187,224
Downloads: 130,316,618

Daily

Ranking: 662 of 187,196
Downloads: 35,914

Depended by

RankDownloadsName
1,26333,314,425html2haml
1,34829,551,773flay
1,50024,146,522flog
1,69018,298,198ruby2ruby
1,87114,695,022protocol
1,91114,119,582rubycritic
2,3028,827,461fasterer
2,6506,563,492hairtrigger
3,8072,692,853churn
4,0142,348,508roodi
5,1681,276,075debride
5,944893,177safemode
6,061851,834dawnscanner
6,065850,464sourcify
6,068848,763i18nliner
7,169574,305wrong
7,232563,541partialruby
7,814491,918quality
8,385417,598ripper_ruby_parser
9,036353,916brakeman-min

Depends on

RankDownloadsName
101,151,463,039rake
64571,436,643racc
185241,656,823rdoc
315138,695,654sexp_processor
2,2858,953,144hoe
21,20271,400oedipus_lex

Owners

#GravatarHandle
1iconzenspider