Sha256: 51c54f0badc51b619ced17aeed7731846f06e6141f78dd7f376510464ef66287
Contents?: true
Size: 681 Bytes
Versions: 13
Compression:
Stored size: 681 Bytes
Contents
# ruby_parser translation Prism ships with the ability to translate its syntax tree into the syntax tree used by the [seattlerb/ruby_parser](https://github.com/seattlerb/ruby_parser) gem. This allows you to use tools built on top of the `ruby_parser` gem with the `prism` parser. ## Usage You can call the `parse` and `parse_file` methods on the `Prism::Translation::RubyParser` module: ```ruby filepath = "path/to/file.rb" Prism::Translation::RubyParser.parse_file(filepath) ``` This will return to you `Sexp` objects that mirror the result of calling `RubyParser` methods, as in: ```ruby filepath = "path/to/file.rb" RubyParser.new.parse(File.read(filepath), filepath) ```
Version data entries
13 entries across 13 versions & 2 rubygems