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

String literal prevents line continuation #1102

Closed
ghost opened this issue Feb 1, 2011 · 2 comments
Closed

String literal prevents line continuation #1102

ghost opened this issue Feb 1, 2011 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 1, 2011

This code gives the error "unexpected outdent". If I add whitespace to the beginning of line 2 it says "unexpected indent". If I remove the : the error goes away! This happens in 1.0 and in the website "try coffeescript".

if y then '' + 
"': '"

I've also seen the problem with the = sign.

@michaelficarra
Copy link
Collaborator

Looks like a bug to me. I am able to reproduce it here on 1.0.1 (currently the latest master). It's extra odd that it works without the colon. That indicates to me that it's yet another problem with the rewriting of implicit objects. It also looks like you came up with a pretty minimal test case (and the "':'" can optionally be replaced with '":"'). Nice find.

@satyr
Copy link
Collaborator

satyr commented Feb 1, 2011

Or:

$ coffee -e '0+
"\"="'
Error: Parse error on line 1: Unexpected 'TERMINATOR'

$ coffee -te '0+
"\"="'
[NUMBER 0] [+ +] [TERMINATOR \n] [STRING "\"="] [TERMINATOR \n]

https://github.com/jashkenas/coffee-script/blob/1.0.1/src/lexer.coffee#L596

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

No branches or pull requests

2 participants