scrubbing all carriage returns from CoffeeScript source before compiling for the benefit of Windows users.

This commit is contained in:
Jeremy Ashkenas
2010-03-08 23:07:26 -05:00
parent dcb00b4fe8
commit 1b4edd0e37
4 changed files with 8 additions and 2 deletions

View File

@@ -35,8 +35,9 @@ exports.Lexer: class Lexer
# Before returning the token stream, run it through the [Rewriter](rewriter.html)
# unless explicitly asked not to.
tokenize: (code, options) ->
code : code.replace(/\r/g, '')
o : options or {}
@code : code or '' # The remainder of the source code.
@code : code # The remainder of the source code.
@i : 0 # Current character position we're parsing.
@line : o.line or 0 # The current line.
@indent : 0 # The current indentation level.