     quote = heredoc.charAt 0
     doc = @sanitizeHeredoc match[2], quote: quote, indent: null
     if quote is '"' and 0 <= doc.indexOf '#{'
-      @interpolateString doc, heredoc: yes, offsetInChunk: 3
+      @interpolateString doc, heredoc: yes, strOffset: 3, lexedLength: heredoc.length
     else
       @token 'STRING', @makeString(doc, quote, yes), 0, heredoc.length
     heredoc.length

      when '"'
        return 0 unless string = @balancedString @chunk, '"'
        if 0 < string.indexOf '#{', 1
          @interpolateString string[1...-1], offsetInChunk: 1
        else
          @token 'STRING', @escapeLines string, 0, string.length
      else

             (expr = @balancedString str[i + 1..], '}')
        continue
      # NEOSTRING is a fake token.  This will be converted to a string below.
      tokens.push @makeToken('NEOSTRING', str[pi...i], strOffset + pi) if pi < i
      inner = expr[1...-1]
      if inner.length
        [line, column] = @getLineAndColumnFromChunk(strOffset + i + 1)
        nested = new Lexer().tokenize inner, line: line, column: column, rewrite: off
        popped = nested.pop()
        popped = nested.shift() if nested[0]?[0] is 'TERMINATOR'
        if len = nested.length
          if len > 1
            nested.unshift @makeToken '(', '(', strOffset + i + 1, 0
            nested.push    @makeToken ')', ')', strOffset + i + 1 + inner.length, 0
          # Push a fake 'TOKENS' token, which will get turned into real tokens below.
          tokens.push ['TOKENS', nested]
      i += expr.length
      pi = i + 1
    tokens.push @makeToken('NEOSTRING', str[pi..], strOffset + pi) if i > pi < str.length

    # If regex, then return now and let the regex code deal with all these fake tokens
    return tokens if regex

    # If we didn't find any tokens, then just return an empty string.
    return @token 'STRING', '""', offsetInChunk, lexedLength unless tokens.length

    # If the first token is not a string, add a fake empty string to the beginning.
    tokens.unshift @makeToken('NEOSTRING', '', offsetInChunk) unless tokens[0][0] is 'NEOSTRING'

    @token '(', '(', offsetInChunk, 0 if interpolated = tokens.length > 1
    # Push all the tokens
    for token, i in tokens
      [tag, value] = token
