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

if expression grabs body without indentation #1122

Closed
edemaine opened this issue Mar 26, 2024 · 1 comment
Closed

if expression grabs body without indentation #1122

edemaine opened this issue Mar 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@edemaine
Copy link
Collaborator

edemaine commented Mar 26, 2024

Here's an input that I think compiles incorrectly:

=>
  extra.push state.start
  extra.push state.goal if state.goal
  {
    extra: new Set extra
  }

Intended compilation:

() => {
  extra.push(state.start)
  if (state.goal) extra.push(state.goal)
  return {
    extra: new Set(extra)
  }
}

Actual compilation:

() => {
  extra.push(state.start)
  return extra.push(state.goal((state.goal?
    ({extra: new Set(extra)}):void 0)))
}

Related to #1121

@edemaine edemaine added the bug Something isn't working label Mar 26, 2024
@STRd6
Copy link
Contributor

STRd6 commented Jul 12, 2024

This is fixed now, we may want to add a test to prevent regressions.

@STRd6 STRd6 closed this as completed Jul 12, 2024
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

No branches or pull requests

2 participants