drop extra comma at the end, unless in single-line dict definition
drop space before `,`