 #                uncheckedMidSection: Math.max 0, matchLen - startLen - endLen
 #                lengthError: matchLen - pLen
 #          else
-#            console.log "Sorry, matchLen (" + matchLen + ") is not between " + 0.5*pLen + " and " + 1.5*pLen
+#            console.log "Sorry, matchLen (" + matchLen + ") is not between " +
+#                0.5*pLen + " and " + 1.5*pLen
 #        else
 #          console.log "endSlice ('" + endSlice + "') not found"
 #      else

  #
  # If no match is found, the function returns null.
  search: (text, pattern, expectedStartLoc = 0, options = {}) ->
#    console.log "In dtm search. text: '" + text + "', pattern: '" + pattern + "', expectedStartLoc: " + expectedStartLoc + ", options:"
#    console.log options
    if expectedStartLoc < 0 then throw new Error "Can't search at negative indices!"


  # You don't need to call the functions below this point manually

  searchForSlice: (text, slice, expectedStartLoc) ->
#    console.log "searchForSlice: '" + text + "', '" + slice + "', " +
#        expectedStartLoc

    r1 = @dmp.match_main text, slice, expectedStartLoc
    startIndex = r1.index
