Filter out unneded begin nodes when determining generated ast equivalency