support \repeat and \alternative