talira

Production-ready Ruby parser written in pure Ruby

open sourceMITfree

Parser is a Ruby parser written in pure Ruby that produces ASTs for Ruby source, recognising as much code as Ripper, ruby_parser and similar parsers or more, and easier to use; unparser turns its ASTs back into equivalent source. It only understands Ruby 3.3 syntax and earlier: for Ruby 3.4 and later its maintainers point to Prism's Prism::Translation::Parser, which produces the same AST.

Problems it solves

  • parse Ruby source code into an AST from Ruby
  • build a Ruby code analysis or refactoring tool
  • get an AST for Ruby 3.3 or older code in Ruby

Features

  • pure-Ruby parser producing ASTs
  • covers Ruby syntax up to 3.3
  • works with unparser to regenerate source

Limitations

  • Only supports Ruby 3.3 syntax and earlier; for Ruby 3.4 and later use Prism::Translation::Parser.1