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

Version Path
prism-1.3.0 docs/ruby_parser_translation.md
prism-1.2.0 docs/ruby_parser_translation.md
prism-1.1.0 docs/ruby_parser_translation.md
prism-1.0.0 docs/ruby_parser_translation.md
prism-0.30.0 docs/ruby_parser_translation.md
prism-0.28.0 docs/ruby_parser_translation.md
prism-0.27.0 docs/ruby_parser_translation.md
prism-0.26.0 docs/ruby_parser_translation.md
prism-0.25.0 docs/ruby_parser_translation.md
jruby-prism-parser-0.24.0-java docs/ruby_parser_translation.md
jruby-prism-parser-0.23.0.pre.SNAPSHOT-java docs/ruby_parser_translation.md
prism-0.24.0 docs/ruby_parser_translation.md
prism-0.23.0 docs/ruby_parser_translation.md