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

[Swift] Tuple destructuring, function call with lambda argument #837

Merged
merged 4 commits into from
Dec 21, 2017

Conversation

dan-zheng
Copy link
Contributor

@dan-zheng dan-zheng commented Dec 12, 2017

I added Swift support for tuple destructuring: addresses issue #833.
I also fixed function calls with lambdas as the first argument.

Before:
2017-12-11 at 10 59 24 pm
When tuple destructuring occurs, let/var are incorrectly parsed as function names instead of keywords.

After:
2017-12-11 at 11 00 00 pm
Tuple destructuring is parsed as expected.

@johnfairh
Copy link
Contributor

Nice - could maybe support backticks around the identifier - currently gives parse errors:
screen shot 2017-12-12 at 12 45 35

(and oops, now I notice the non-destructuring form with backticks gives the wrong syntax type...)

In case you haven't seen it there's a spec/visual/samples/swift file where your examples could go.

@dan-zheng
Copy link
Contributor Author

Good catches!
I added a rule to handle backticks around identifiers in tuple destructuring.
I also fixed the syntax type of the non-destructuring form with backticks.

I added examples to the spec/visual/samples/swift file, as you suggested.
2017-12-12 at 10 51 38 am

@dan-zheng dan-zheng changed the title Swift support for tuple destructuring [Swift] Tuple destructuring, func call with lambda arg Dec 16, 2017
@dan-zheng dan-zheng changed the title [Swift] Tuple destructuring, func call with lambda arg [Swift] Tuple destructuring, function call with lambda argument Dec 16, 2017
@gfx
Copy link
Member

gfx commented Dec 21, 2017

Cool. Thanks for your contributions.

@gfx gfx merged commit 16872c2 into rouge-ruby:master Dec 21, 2017
@gfx gfx added the bugfix-request A request for a bugfix to be developed. label Dec 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix-request A request for a bugfix to be developed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants