Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support syntax change for call in Ruby 2.6 #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

segunn
Copy link

@segunn segunn commented Apr 16, 2019

In Ruby 2.5.5, Ripper::SexpBuilder.new(thing.stuff).parse gives this output:

[:program,
[:stmts_add,
[:stmts_new],
[:call,
[:vcall, [:@Ident, thing, [1, 0]]],
:.,
[:@Ident, stuff, [1, 6]]]]]

but in Ruby 2.6.2, it gives this output:

[:program,
[:stmts_add,
[:stmts_new],
[:call,
[:vcall, [:@Ident, thing, [1, 0]]],
[:@period, ., [1, 5]],
[:@Ident, stuff, [1, 6]]]]]

This means it is no longer safe to assume that the third item in the :call array can be emitted without any processing, and we need to call resource on it

 In Ruby 2.5.5, Ripper::SexpBuilder.new(thing.stuff).parse gives this output:

[:program,
 [:stmts_add,
  [:stmts_new],
  [:call,
   [:vcall, [:@Ident, thing, [1, 0]]],
   :.,
   [:@Ident, stuff, [1, 6]]]]]

 but in Ruby 2.6.2, it gives this output:

 [:program,
 [:stmts_add,
  [:stmts_new],
  [:call,
   [:vcall, [:@Ident, thing, [1, 0]]],
   [:@period, ., [1, 5]],
   [:@Ident, stuff, [1, 6]]]]]

This means it is no longer safe to assume that the third item in the :call array can be emitted without any processing, and we need to call resource on it
@searls
Copy link

searls commented Jun 8, 2019

Hi @segunn. I've attained write access to sorcerer on rubygems.org so I've forked the repo to the rspec-given org here: https://github.com/rspec-given/sorcerer

Would you mind sending this PR there and helping by getting rake test to pass?

@yb66
Copy link

yb66 commented Oct 25, 2019

Any idea when this might happen? I can make the PR if that's all that's needed.

Regards,
iain

@segunn
Copy link
Author

segunn commented Oct 25, 2019

Apologies for the delay - I'd been hoping to find time to also fix the pre-existing broken tests but haven't managed it yet. I've made the PR with just this change for now

@searls
Copy link

searls commented Dec 2, 2019

For the record @yb66 & @segunn, this was merged into the rspec-given org fork of sorcerer: rspec-given#1

However, because I had problems getting the tests to run and pass I was wary of pushing a new version to RubyGems at the time

@searls
Copy link

searls commented Dec 2, 2019

Ok, this is landed in sorcerer@2.0.0 after lots of build fixes

@yb66
Copy link

yb66 commented Dec 4, 2019

Thanks for all the work, @searls and @segunn, much appreciated (not just by me, I'm sure!)

Regards,
iain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants