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

Indented function parameters #760

Closed
edemaine opened this issue Oct 2, 2023 · 0 comments · Fixed by #816
Closed

Indented function parameters #760

edemaine opened this issue Oct 2, 2023 · 0 comments · Fixed by #816
Labels
bug Something isn't working

Comments

@edemaine
Copy link
Collaborator

edemaine commented Oct 2, 2023

Input

foo := (
  x
  ...rest
) -> null

Current Output

const foo = x(...rest)(function () {
  return null;
});

Expected Output

function foo(x, ...rest) {
  return null;
}

Workaround

foo := (
  x
  rest...
) -> null

Plan

@STRd6:

We'll want to add a nested version of NonEmptyParameters similar to how we do object and arrays

In particular to handle inputs like:

function f<T>(
  t:
    item: T
  u:
    item: T
)

(which currently works but doesn't really understand the middle indentation level)

@edemaine edemaine added the bug Something isn't working label Oct 2, 2023
edemaine added a commit that referenced this issue Oct 2, 2023
edemaine added a commit that referenced this issue Nov 23, 2023
Rewrite NonEmptyParameters to include Nested forms.

Fixes #760.  Fixes #811.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant