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

Lexer: export default and child braces sometimes trigger “unexpected indentation” #4774

Closed
GeoffreyBooth opened this issue Nov 7, 2017 · 0 comments

Comments

@GeoffreyBooth
Copy link
Collaborator

Minimal case:

export default
  a: {
    b: 1
  }
  c: 2
[stdin]:5:1: error: unexpected indentation
  c: 2
^^

Interestingly, if export default is replaced with return, it compiles as expected.

If braces are added around the entire exported object (export default {...}), it also compiles; so that can be the workaround for anyone dealing with this right now. I stumbled across it because of trying to use an object spread in the object:

export default
  a: {
    b...
  }
  c: 2

Which requires braces around the b....

GeoffreyBooth added a commit to GeoffreyBooth/coffeescript that referenced this issue Nov 12, 2017
…ays work, even if the object contains braces. `default` shouldn't suppress a newline, we should handle it in the grammar the same way returning an implicit object is handled
GeoffreyBooth added a commit that referenced this issue Nov 16, 2017
… even if the object contains braces. `default` shouldn't suppress a newline, we should handle it in the grammar the same way returning an implicit object is handled (#4783)
@jashkenas jashkenas added the bug label Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants