Sha256: a1f3062ebcede222dd9e672f5249ef8552fbaa1a1c661127da1c1442c2a1a0d2

Contents?: true

Size: 1.79 KB

Versions: 10

Compression:

Stored size: 1.79 KB

Contents

unparser
========

[![Build Status](https://secure.travis-ci.org/mbj/unparser.png?branch=master)](http://travis-ci.org/mbj/unparser)
[![Dependency Status](https://gemnasium.com/mbj/unparser.png)](https://gemnasium.com/mbj/unparser)
[![Code Climate](https://codeclimate.com/github/mbj/unparser.png)](https://codeclimate.com/github/mbj/unparser)

Generate equivalent source for ASTs from whitequarks awesome [parser](https://github.com/whitequark/parser).

This library is in early development stage and still has some bugs/missing features.
Nevertheless it is able to regenerate it own source and serves well for
[mutant](https://github.cm/mbj/mutant) mutators and the in-memory vendoring for self hosting mutant.

Usage
-----

```ruby
require 'unparser'
Unparser.unparse(your_ast) # => "the code"
```

Equivalent vs identical:

```ruby
require 'unparser'

code = <<-RUBY
%w(foo bar)
RUBY

node = Parser::CurrentRuby.parse(code)

generated = Unparser.unparse(node) # ["foo", "bar"], NOT %w(foo bar) !

code == generated                            # false, not identical code
Parser::CurrentRuby.parse(generated) == node # true, but identical AST
```

Summary: unparser does not reproduce your source! It produces equivalent source.

Installation
------------

Install the gem `unparser` via your prefered method.

Credits
-------

* [Markus Schirp (mbj)](https://github.com/mbj) Author

Contributing
-------------

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with Rakefile or version
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

License
-------

See LICENSE file.

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
unparser-0.0.18 README.md
unparser-0.0.16 README.md
unparser-0.0.15 README.md
unparser-0.0.14 README.md
unparser-0.0.13 README.md
unparser-0.0.12 README.md
unparser-0.0.11 README.md
unparser-0.0.10 README.md
unparser-0.0.8 README.md
unparser-0.0.7 README.md