use consistently Array#[-1] instead of Array#last
introduced @current_node in TreeStack