michaelficarra / CoffeeScriptRedux

:sweat: rewrite of the CoffeeScript compiler with proper compiler design principles and a focus on robustness and extensibility
https://michaelficarra.github.com/CoffeeScriptRedux/
BSD 3-Clause "New" or "Revised" License
1.84k stars 110 forks source link

CR after line continuation backslash leads to syntax error #328

Open provegard opened 10 years ago

provegard commented 10 years ago

Just tried to migrate a project from the original compiler to redux. One of the errors I encountered is this:

angular.module("foobar", ["dep1", \
    "dep2"])

I get:

Syntax error on line 2, column 4: unexpected '(INDENT)' (\uEFEF)
1 : angular.module("foobar", ["dep1", \
2 :     "dep2"])
^ :~~~~^
3 :
4 :

The reason is that the backslash is followed by CRLF since I'm on Windows. The problem appears to be already in the preprocessor and I have a fix for it. I'll open a PR.

Note: I initially thought I'd hit #83, but this is slightly different and my fix certainly doesn't help that issue at all.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/4118228-cr-after-line-continuation-backslash-leads-to-syntax-error?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github).