[Bug #19392] Make args connected with and/or as a body of method#8054
Open
yui-knk wants to merge 2 commits intoruby:masterfrom
Open
[Bug #19392] Make args connected with and/or as a body of method#8054yui-knk wants to merge 2 commits intoruby:masterfrom
and/or as a body of method#8054yui-knk wants to merge 2 commits intoruby:masterfrom
Conversation
`def test = puts("foo") or puts("bar")` is interrupted as
`def test = (puts("foo") or puts("bar"))`.
nobu
approved these changes
Jul 12, 2023
Contributor
|
Unfortunately, this PR doesn't fix def foo(arg) = p("OK") if arg
foo(false)
foo(true)This is expected (with "natural" for the author precedences) to print "OK" once, but instead it fails with Apparently, it is still interpreted as (def foo(arg) = p("OK")) if argWould it be possible to handle in the same manner? 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
def test = puts("foo") or puts("bar")is interrupted asdef test = (puts("foo") or puts("bar")).[Note] (2023-12-07) I created this patch to demonstrate it's not difficult to support this feature with LR parser generator. This doesn't mean I agree with the change.