Move optional syntax definitions inside if-guard