Support switch .. when syntax.