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

Coffeescript chokes on unmatched quotes in comments #44

Closed
chreekat opened this issue Feb 24, 2012 · 2 comments
Closed

Coffeescript chokes on unmatched quotes in comments #44

chreekat opened this issue Feb 24, 2012 · 2 comments

Comments

@chreekat
Copy link
Contributor

The following CoffeeScript fails to compile:

addJulius [coffee|(
    # That's a wrap
    alert "Hi")|]

Take out the quote, or add one, and it works.

@chreekat
Copy link
Contributor Author

By the way, this is relatively new: it popped up when I migrated from 0.10 to 0.11.

@gregwebs
Copy link
Member

We now enforce proper English in comments :)

Actually, we have to compile coffeescript at compile time into valid coffeescript while still allowing for variable insertion. The variable insertion syntax is illegal so it is escaped with coffeescript's backticks. However, inside a string (quotes) it is perfectly legal.

I would like to avoid writing my own coffeescript compiler, but I see 2 solutions 2 this neither of which seem horribly difficult.

  1. first check to see if there is any variable interpolation
  2. ignore comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants