sh.rs: improvements to the ';' handling