Skip to content

Block comments cause "Unexpected TERMINATOR" at end of objects #3159

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

Closed
geoffreak opened this issue Sep 6, 2013 · 5 comments
Closed

Block comments cause "Unexpected TERMINATOR" at end of objects #3159

geoffreak opened this issue Sep 6, 2013 · 5 comments

Comments

@geoffreak
Copy link

The following code does not compile (but seems like it should):

module.exports = 
  test: true

  ###
  Block comment
  ###
$ coffee -c test.coffee
test.coffee:2:13: error: unexpected TERMINATOR
  test: true

However, adding any kind of runnable code after the block comment allows for compilation:

module.exports = 
  test: true

  ###
  Block comment
  ###

  foobar: true

Or

module.exports = 
  test: true

  ###
  Block comment
  ###

foo = bar

Commenting the runnable code gets us back to the unexpected error:

module.exports = 
  test: true

  ###
  Block comment
  ###

  # foobar: true
$ coffee -c test.coffee
test.coffee:2:13: error: unexpected TERMINATOR
  test: true

I really hope this isn't intended behavior

$ coffee -v
CoffeeScript version 1.6.3
$ node -v
v0.10.12
@michaelficarra
Copy link
Collaborator

Hahaha this one is giving "UNEXPECTED MATH" a run for its money. This needs to be added to the FAQ. @geoffreak: for now, just search previous issues.

@geoffreak
Copy link
Author

Can I get an actual explanation? Searches don't turn up anything relating to my issue.

@michaelficarra
Copy link
Collaborator

Sure: #2805, #1559, #2973, #2025, #2445, #1925, #2344, #1375

@geoffreak
Copy link
Author

Thanks. I do hope something will be done about this to prevent it throwing an error though.

@GeoffreyBooth
Copy link
Collaborator

The original example is fixed via #4572. Sorry it took awhile.

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

3 participants