def CleanseComments(line):
 commentpos = line.find('//')
 if ((commentpos != (-1)) and (not IsCppString(line[:commentpos]))):
  line = line[:commentpos].rstrip()
 return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line)

def CleanseComments ( line ) : commentpos = line . find ( '//' ) if ( ( commentpos != ( - 1 ) ) and ( not IsCppString ( line [ : commentpos ] ) ) ) : line = line [ : commentpos ] . rstrip ( ) return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS . sub ( '' , line )
removes //-comments and single-line c-style /* */ comments .