if
statement contains a else
part?
# Does this `if` statement contains a `else` part?
private fun has_else(v: PrettyPrinterVisitor): Bool do
var n_else = n_else
if n_else == null then return false
var n_kwelse = collect_kwelse
if n_kwelse == null then return false
if n_else isa ABlockExpr then
var comments: Array[TComment]
if n_then == null then
comments = v.collect_comments(n_expr.last_token, n_else.last_token)
else
comments = v.collect_comments(n_then.last_token, n_else.last_token)
end
if not comments.is_empty then return true
return not n_else.n_expr.is_empty
end
return true
end
src/pretty.nit:1365,2--1386,4