def _calc_end(text, start):
 if (len(text) == 1):
  new_end = (start + Position(0, len(text[0])))
 else:
  new_end = Position(((start.line + len(text)) - 1), len(text[(-1)]))
 return new_end

def _calc_end ( text , start ) : if ( len ( text ) == 1 ) : new_end = ( start + Position ( 0 , len ( text [ 0 ] ) ) ) else : new_end = Position ( ( ( start . line + len ( text ) ) - 1 ) , len ( text [ ( - 1 ) ] ) ) return new_end
calculate the end position of the text starting at start .