Prism
Prism is a new parsing gem in Ruby 3.3 that’s likely to be the future parsing library for Ruby and Ruby tooling. Prism can be used as a stand-alone gem; it is also included with the Ruby standard library. You can use it with require "prism".
Prism is designed to be a common parser across Ruby implementations, and as of this writing, it’s also integrated into Ruby and TruffleRuby, among others. It’s also used by the ruby-lsp language server.
Prism is designed to be tolerant to errors. For example, if you’re typing a file in your editor, Prism tries not to let syntax errors in one part of the file affect the parsing of the rest of the file, making for a much better development experience while typing.
Prism includes an API that you can ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access