rewrite SwitchStatement in spider