def CheckEmptyBlockBody(filename, clean_lines, linenum, error):
 line = clean_lines.elided[linenum]
 matched = Match('\\s*(for|while|if)\\s*\\(', line)
 if matched:
  (end_line, end_linenum, end_pos) = CloseExpression(clean_lines, linenum, line.find('('))
  if ((end_pos >= 0) and Match(';', end_line[end_pos:])):
   if (matched.group(1) == 'if'):
    error(filename, end_linenum, 'whitespace/empty_conditional_body', 5, 'Empty conditional bodies should use {}')
   else:
    error(filename, end_linenum, 'whitespace/empty_loop_body', 5, 'Empty loop bodies should use {} or continue')

def CheckEmptyBlockBody ( filename , clean_lines , linenum , error ) : line = clean_lines . elided [ linenum ] matched = Match ( '\\s*(for|while|if)\\s*\\(' , line ) if matched : ( end_line , end_linenum , end_pos ) = CloseExpression ( clean_lines , linenum , line . find ( '(' ) ) if ( ( end_pos >= 0 ) and Match ( ';' , end_line [ end_pos : ] ) ) : if ( matched . group ( 1 ) == 'if' ) : error ( filename , end_linenum , 'whitespace/empty_conditional_body' , 5 , 'Empty conditional bodies should use {}' ) else : error ( filename , end_linenum , 'whitespace/empty_loop_body' , 5 , 'Empty loop bodies should use {} or continue' )
look for empty loop/conditional body with only a single semicolon .