Implement Merge and Subst parsing