yujinakayama / transpec

The RSpec syntax converter
http://yujinakayama.me/transpec/
MIT License
1.01k stars 52 forks source link

remove Parser::Rewriter deprecation #130

Closed kirylrb closed 6 years ago

kirylrb commented 6 years ago

TreeRewriter has simplified semantics, and customizable policies with regards to clobbering. Please read the documentation.

Rewriter was discarding the end_pos of the given range for insert_before, and the begin_pos for insert_after. These are meaningful in TreeRewriter.

TreeRewriter's wrap/insert_before/insert_after are multiple by default, while Rewriter would raise clobbering errors if the non '_multi' version was called.

The TreeRewriter policy closest to Rewriter's behavior is:

different_replacements: :raise, swallowed_insertions: :raise, overlapping_deletions: :accept

http://www.rubydoc.info/github/whitequark/parser/Parser/Source/Rewriter

Rubocop team made related changes in February: https://github.com/bbatsov/rubocop/issues/5579

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-33.5%) to 65.152% when pulling b0df5ec2315be3973593272c95905ea2e8d881cc on kirylpl:master into 3a38f5fd4843ff5e72d393904064c2e16e59a732 on yujinakayama:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.7%) to 97.907% when pulling a3bb7307054a8f0cb823c0d6ee62208586f62323 on kirylpl:master into 3a38f5fd4843ff5e72d393904064c2e16e59a732 on yujinakayama:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.7%) to 97.907% when pulling a3bb7307054a8f0cb823c0d6ee62208586f62323 on kirylpl:master into 3a38f5fd4843ff5e72d393904064c2e16e59a732 on yujinakayama:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.7%) to 97.907% when pulling a3bb7307054a8f0cb823c0d6ee62208586f62323 on kirylpl:master into 3a38f5fd4843ff5e72d393904064c2e16e59a732 on yujinakayama:master.

yujinakayama commented 6 years ago

I'll do the migration to TreeRewriter in #133 since most of your changes are not correct.

Anyway, thank you for the heads up!