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
+ ruby28.y: endless method definition #676
Conversation
I think it's too early to start implementing these new features at least because I'm not sure what will be the next MRI version. Are you sure it's going to be 2.8 and not 3.0? |
Currently, it's named 2.8 🤷🏻♂️ I'm going to implement these (controversal) features for Ruby Next as soon as possible 🙂. The purpose of this PR is to discuss the API to make it possible to merge these features to Parser easily when 3.0 became stable. And to let you know that I plan to work on this) Probably, it's better to open a PR in https://github.com/ruby-next/parser and link to the issue instead. WDYT? |
ok, let's keep it as 2.8 for now. We can rename files whenever we want. Could you split it into 2 PRs please? |
04769a4
to
ffc56ad
Compare
ffc56ad
to
f861723
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -46,6 +46,7 @@ module Source | |||
require 'parser/source/map/variable' | |||
require 'parser/source/map/keyword' | |||
require 'parser/source/map/definition' | |||
require 'parser/source/map/endless_definition' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think that someday MRI developers may introduce endless classes/methods, so maybe we'll reuse it:
class A = def m = 42
module M = def m = 42
@palkan feel free to merge it |
f861723
to
67f58c0
Compare
67f58c0
to
c839a26
Compare
c839a26
to
94f65c2
Compare
Refactoring before adding endless method
94f65c2
to
190c50f
Compare
By semantic, I meant "related to the meaning of the code". It's in that sense that I don't consider the locations to be semantic. @bbatsov I hope things are going better for you today 😄 So where are we at? Possibilities are:
I'll be happy with 2 or 3 (with either defaults) and I'll definitely survive with 1. |
I'm not the best person to ask because I don't use parser (and if I'd use it starting from today there would be no difference). All 3 options are fine for me. Also I'm actually slightly confused that new nodes cause exceptions. |
Although ruby-next already uses I'm OK with any option, maybe, except from the 3rd one: introducing a flag is more like postponing the final decision. |
TBD