fix wrong condition and unnecessary newline
improve variable name; current_indent -> previous_indent
fix condition to check indent level
fix pattern to recognize empty lines

'#' is not a comment leader in Go. ('//' does.)
fix pushing indent block information
close all blocks at the end of code when non-closing blocks remain