Generalize MacExpr / MacPat / MacItems

Closes #17637