           i += expr.length - 1
           pi = i + 1
         i += 1
-      tokens.push ['STRING', quote + str.substring(pi, i) + quote] if pi < i and pi < str.length - 1
+      tokens.push ['STRING', quote + str[pi...i] + quote] if i > pi < str.length - 1
       tokens.unshift ['STRING', '""'] unless tokens[0][0] is 'STRING'
       interpolated = tokens.length > 1
       @token '(', '(' if interpolated

  # Matches strings, including multi-line strings. Ensures that quotation marks
  # are balanced within the string's contents, and within nested interpolations.
  stringToken: ->
    return false unless starts(@chunk, '"') or starts(@chunk, "'")
    return false unless string =
      @balancedToken(['"', '"'], ['#{', '}']) or
      @balancedToken ["'", "'"]
    @interpolateString string.replace MULTILINER, '\\\n'
    @line += count string, "\n"
    @i += string.length
    true


    slash = delimited[0][0] is '/'
    levels = []
    i = 0
    slen = str.length
    while i < slen
      if levels.length and str.charAt(i) is '\\'
        i += 1
      else
        for pair in delimited
