[Gravity] Codereview ammend: shortened sql_parentheses_close function and standardized coding style