simplify semicolon handling for alternative and declaration