Conservative pretty printing

Martin Andreas Rückert · ACM SIGPLAN Notices · 1997

The main purpose of the pretty printing tool, presented here, is not so much the complete reformating of a program but is described better as finding and correcting formating errors.A set of relations is given describing the proper alignment of a piece of code in accordance with its syntactic structure. It is complemented by a simple algorithm to change any given source code to satisfy these relations.The relations are flexible enough to allow a variety of different formating styles while rejecting formating errors, i.e. code that is not formated according to its syntactic structure.Various examples illustrate the ideas, the problems, the goals, and the achievements.

Read the paper · More papers on PaperTik