ruby_parser version 3.22.0 has been released!
* home: <https://github.com/seattlerb/ruby_parser>
* bugs: <https://github.com/seattlerb/ruby_parser/issues>
* rdoc: <http://docs.seattlerb.org/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.
Changes:
### 3.22.0 / 2025-12-20
* 1 major enhancement:
* Announced the EOL of ruby_parser! YAY!
* 6 minor enhancements:
* 3.3: working down the grammar structural differences.
* Added tentative 3.4 support.
* Renamed assignable to old_assignable and added newer cleaner assignable
* Restructured comparison rake tasks and normalization to deal with lrama changes.
* Updated compare versions and added 3.4.
* Updated grammars to fit most closely to ruby 3.2. Working it down the line.
* 11 bug fixes:
* Always raise RubyParser::SyntaxError (wrap and raise).
* Bumped ruby version to 3.2+.
* Cleaned up user_variable productions to always return sexps.
* Corrections and enhancements for gauntlet.md instructions.
* Fixed rake compare's clean subtask to nuke the unpacked ruby dirs entirely.
* Fixed superclass of V34.
* Fixed up a couple errors created by using STRICT_SEXP=2. 3 will be neigh impossible.
* I am nothing if not stubborn: fixed errors caused by STRICT_SEXP=3.
* Minor fixes for 3.2+ grammars on "defined?" expressions.
* Removed a lot of ancient compatibility checks and patches. (eg encodings)
* This in turn cleaned up var_ref and a bunch of other productions.
···
______________________________________________
ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org
To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org
ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org/