   # Before returning the token stream, run it through the [Rewriter](rewriter.html)
   # unless explicitly asked not to.
   tokenize: (code, options) ->
-    code     = code.replace /(\r|\s+$)/g, ''
+    code     = code.replace(/\r/g, '').replace /\s+$/, ''
     o        = options or {}
     @code    = code         # The remainder of the source code.
     @i       = 0            # Current character position we're parsing.

  # referenced as property names here, so you can still do `jQuery.is()` even
  # though `is` means `===` otherwise.
  identifierToken: ->
    return false unless id = @match IDENTIFIER, 1
    @i += id.length
    forcedIdentifier = @tagAccessor() or @match ASSIGNED, 1
    tag = 'IDENTIFIER'

    indent = options.indent
    return doc if options.herecomment and not include doc, '\n'
    unless options.herecomment
      while (match = HEREDOC_INDENT.exec doc)
        attempt = if match[1]? then match[1] else match[2]
        indent = attempt if not indent? or 0 < attempt.length < indent.length
    indent or= ''
    doc = doc.replace(new RegExp("^" + indent, 'gm'), '')
