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: 335 of 188,252
Downloads: 132,038,842

Daily

Ranking: 593 of 188,232
Downloads: 42,214

Depended by

RankDownloadsName
1,27433,592,635html2haml
1,35430,170,957flay
1,50924,723,475flog
1,70018,634,121ruby2ruby
1,90214,821,525protocol
1,91914,604,364rubycritic
2,3099,089,259fasterer
2,6406,820,873hairtrigger
3,8522,723,711churn
4,0682,363,347roodi
5,1451,322,030debride
5,999900,271safemode
6,106863,017dawnscanner
6,115860,834i18nliner
6,124857,618sourcify
7,224584,117wrong
7,365565,821partialruby
7,892496,448quality
8,490420,110ripper_ruby_parser
9,083362,061brakeman-min

Depends on

RankDownloadsName
101,188,890,086rake
60602,062,281racc
179258,159,855rdoc
323140,699,274sexp_processor
2,3109,049,897hoe
21,06873,864oedipus_lex

Owners

#GravatarHandle
1iconzenspider