V, 25, 24 bytes
3wC] = {òJd2f $s, òhC}; Try it online! This contains an unprintable <esc> character, so here is a hexdump:
0000000: 3377 435d 203d 207b 1bf2 4a64 3266 2024 3wC] = {..Jd2f $ 0000010: 732c 20f2 6843 7d3b s, .hC}; I will post an explanation later.Explanation:
3w "Move forward 3 words C <esc> "Delete everything until the end of the line, and enter this text: ] = { "'] = {' ò ò "Recursively: J " Join these two lines (which enters a space) d " Delete everything until you 2f " (f)ind the (2)nd space $ " Move to the end of this line s " Delete a character, and enter: , " ', ' " h "Move one character to the left C "Delete everything until the end of the line, and enter this text: }; "'};'