check ast has macro pattern earlier