Skip to content

Conversation

ignatiusreza
Copy link

@ignatiusreza ignatiusreza commented Oct 19, 2018

redmine ticket: https://bugs.ruby-lang.org/issues/15236

inspired by javascript support for object literal shorthand { a }, which will be expanded into { a: a }..

to avoid ambiguity, this shorthand is only supported when hash is defined explicitly with { } notation..

in other situation where the brackets is optional, e.g. function call, we still need to write it in full (m(a: a) instead of m(a), or m(a, b, c: c) instead of m(a, b, c)..

PS: This is my first time contributing to ruby, and also my first time reading and modifying a parser.. I'm not quite sure if what I did is a good approach.. any help or guidance will be highly appreciated.. 🙇‍♂️

@ignatiusreza
Copy link
Author

Sorry, looks like test failed.. I'll take a look on Monday

@ignatiusreza ignatiusreza force-pushed the hash/shorthand branch 4 times, most recently from 7d92237 to 69e1f56 Compare October 22, 2018 07:56
inspired by javascript support for object literal shorthand `{ a }`,
which will be expanded into `{ a: a }`..

to avoid ambiguity, this shorthand is only supported when hash is
defined explicitly with `{ }` notation..

in other situation where the brackets is optional, e.g. function call,
we still need to write it in full
(`m(a : a)` instead of `m(a)`, or `m(a, b, c: c)` instead of `m(a, b, c)`..
@nobu
Copy link
Member

nobu commented Aug 11, 2019

This has been rejected

@nobu nobu closed this Aug 11, 2019
@ignatiusreza ignatiusreza deleted the hash/shorthand branch October 28, 2019 05:47
@hsbt hsbt added the Backport label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants