Avoid an infinite loop in expressions

If a colon or semicolon appeared in some states where an expression was
expected, it would go into an infinite loop, even in cases where the
character was allowed.