Just put 'if body_node:' here and indented the p_nodes declaration and processing loop.