original_string: protected static function semicolonTerminate( $sql ) {
  		$lines = explode("\n", $sql);
  		$lastLineK = null;
  		foreach( $lines as $k=>$line ) {
  			$line = trim($line);
  			if( !preg_match('/^$|^--$|^--\s+/', $line) ) $lastLineK = $k;
  		}
  		if( $lastLineK !== null and !preg_match('/;$/', $lines[$lastLineK]) ) {
  			$lines[$lastLineK] .= ";";
  			return implode("\n", $lines);
  		} else {
  			return $sql;
  		}
  	}
code: protected static function semicolonTerminate( $sql ) {
  		$lines = explode("\n", $sql);
  		$lastLineK = null;
  		foreach( $lines as $k=>$line ) {
  			$line = trim($line);
  			if( !preg_match('/^$|^--$|^--\s+/', $line) ) $lastLineK = $k;
  		}
  		if( $lastLineK !== null and !preg_match('/;$/', $lines[$lastLineK]) ) {
  			$lines[$lastLineK] .= ";";
  			return implode("\n", $lines);
  		} else {
  			return $sql;
  		}
  	}
code_tokens: protected static function semicolonTerminate ( $ sql ) { $ lines = explode ( "\n" , $ sql ) ; $ lastLineK = null ; foreach ( $ lines as $ k => $ line ) { $ line = trim ( $ line ) ; if ( ! preg_match ( '/^$|^--$|^--\s+/' , $ line ) ) $ lastLineK = $ k ; } if ( $ lastLineK !== null and ! preg_match ( '/;$/' , $ lines [ $ lastLineK ] ) ) { $ lines [ $ lastLineK ] .= ";" ; return implode ( "\n" , $ lines ) ; } else { return $ sql ; } }
docstring: Make sure the last non-comment line ends with a semicolon.
docstring_tokens: Make sure the last non - comment line ends with a semicolon .