This is an archive of the discontinued Mercurial Phabricator instance.

stringutil: emit multiple chunks when pretty printing
ClosedPublic

Authored by indygreg on Aug 27 2018, 12:15 PM.

Details

Summary

This avoids concatenating output inside pprintgen() itself. But
the real reason for this is it will make it easier to add
indentation, as we'll need to account for indentation when emitting
each individual object in a collection.

The verbosity of this code compared to the original is a bit
unfortunate. But I suppose this is the price to pay for having
nice things (streaming and indenting).

We could probably abstract the "print a collection" bits into a
generic function to avoid some duplication. But I'm not
overly inclined to do this.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Aug 27 2018, 12:15 PM
pulkit accepted this revision.Aug 29 2018, 4:05 PM
This revision was automatically updated to reflect the committed changes.