In the “reduced coordination” construction known as Right Node Raising (RNR), a constituent on the right (final) end of a clause is combined with a loose coordination of two non-constituents, while being interpreted as being in construction with each of them. A simple example:
Kim discovered, but Lee publicized, the Disappearing Cat Effect.
The Disappearing Cat Effect is the shared constituent on the right. The two preceding conjuncts, Kim discovered and Lee publicized, are not themselves constituents; each is a clause missing a direct object.
RNR examples have different prosodies, and some are much more syntactically complex than this one. Today’s datum, from a KQED-FM begathon in which the announcer was asking people to phone in pledges to volunteers:
That’s what they came here, and that’s what they gave up their Saturday morning for.
Here, the shared constituent on the right is the single P for, the whole sentence being understoood as ‘That’s what they came here for, and that’s what they gave up their Saturday morning for’. You have to wait a long time for that for.
So, grammatical, but notable.