France's president has pledged to punish rioters over violent protests across the nation.