fixing trailing whitespace on the final line

This commit is contained in:
Jeremy Ashkenas 2010-03-16 19:57:39 -04:00
parent 391135b1a5
commit 61b011cc28
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@
// unless explicitly asked not to.
Lexer.prototype.tokenize = function tokenize(code, options) {
var o;
code = code.replace(/\r/g, '');
code = code.replace(/(\r|\s+$)/g, '');
o = options || {};
this.code = code;
// The remainder of the source code.

View File

@ -43,7 +43,7 @@ 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, '')
code : code.replace(/(\r|\s+$)/g, '')
o : options or {}
@code : code # The remainder of the source code.
@i : 0 # Current character position we're parsing.