Use switch expressions in PathExpressionParser